2

I am new to PHP and I'm currently learning about PHP from the point of view of managing a web server. I believe that PHP extensions are like plugins which enable added functionality to the default PHP set-up - I know this is a very basic overview but is my simplification correct?

I have also noticed PECL and PEAR on my cPanel set-up and have not even began to enquire what they are as I want to understand the basics of how PHP works.

I'd value any input just to help my novice brain process this.

  • Offtopic, so as a comment: Since you're beginning: Learn to build security-first. That'll make you're code a whole lot safer down the line. – Martijn Dec 5 '16 at 8:14
  • I'm not so sure this is off-topic. While PHP is a programming language, he is asking the question from the perspective of a webmaster installing a website through cPanel. Programming questions are better on StackOverflow, but I don't think this is a queston that would be appropriate there. – Stephen Ostermiller Dec 5 '16 at 11:52
4

The simple answer is that most of the PHP functionallity is in the basic setup and you probally don't need to worry about this.

But, extensions are exactly as they sound like, they extend PHP functionallity. You have a MYSQL extension which allows you to connect to a database with premade functions (this extension is mostly on by default, unless you have a bad hoster).

If you do phpinfo(); in a php file, there will be a section called 'modules loaded', which lists all of them. Most of the usefull ones are already included.

Turning these extensions on is possible via various methods, often in the php.ini (the settings file for PHP). If you want to change this, you'll need root access to the server, which you often dont have with shared hosting (but, again, you don't really need this when you just begin).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy