HomeBlogsEnable PHP on Apache for Mac OS Yosemite & Mavericks

Enable PHP on Apache for Mac OS Yosemite & Mavericks

This guide is about the How to Enable PHP in Apache for Mac OS X Yosemite & Mavericks. I will try my best so that you understand this guide very well. I hope you all like this guide How to Enable PHP in Apache for Mac OS X Yosemite & Mavericks.

OS X Mavericks comes with PHP 5.4.30, and OS X Mountain Lion comes with PHP 5.3.13 pre-installed, but if you start the built-in Apache server, you’ll notice that PHP isn’t enabled by default. Changing this is easy, and if you’re a web developer and want PHP to run on your local Mac with OS X 10.8 or later, follow it to make it work quickly.

Start Terminal and enter the following command using the administrator password when prompted:

sudo nano /etc/apache2/httpd.conf

Now click Control + W to use the nano search function and type “php”

Find the following line and remove the comment (#) from the beginning:

LoadModule php5_module libexec / apache2 / libphp5.so

Enable PHP5 on OS X.

Click Control + O to save the changes, and then press Control + X to turn off the nano.

To return to the command prompt, you must restart the Apache server for the php module to load. This is done by using the following command, or you can change the power switch to third-party WebSharing panel:

sudo apachectl restarts

Apache will reboot quickly and PHP will be enabled.

To check this, drop any php file in the ~ / Sites / directory and load localhost / ~ user / file.php, or use the phpinfo () extension in the current php configuration by placing the following in any file with the php extension:

Save the file to the user’s ~ / Sites / directory and upload it to a web browser.

To make changes to the PHP configuration, run the following command with a copy of the default php.ini file:

cp /private/etc/php.ini.default /private/etc/php.ini

If necessary, make changes to the copied php.ini file in the / etc / or / private / etc / directory so that the original .default file is intact. As usual, major changes to the php.ini file must follow a second Apache restart for it to take effect.

Benefits: How to Enable PHP in Apache for Mac OS X Yosemite & Mavericks

  • The How to Enable PHP in Apache for Mac OS X Yosemite & Mavericks guide is free to read.
  • We help many internet users follow up with interest in a convenient manner.
  • The price of the How to Enable PHP in Apache for Mac OS X Yosemite & Mavericks guide is free.

FAQ: How to Enable PHP in Apache for Mac OS X Yosemite & Mavericks

In this guide, I told you about the How to Enable PHP in Apache for Mac OS X Yosemite & Mavericks.

In this guide, I discuss about the How to Enable PHP in Apache for Mac OS X Yosemite & Mavericks, which is very helpful.

Apple Devices only.

mac OS or iOS

Final note: How to Enable PHP in Apache for Mac OS X Yosemite & Mavericks

If you have any queries regards the How to Enable PHP in Apache for Mac OS X Yosemite & Mavericks, then please ask us through the comment section below or directly contact us.
Education: This guide or tutorial is just for educational purposes.
Misinformation: If you want to correct any misinformation about the guide “How to Enable PHP in Apache for Mac OS X Yosemite & Mavericks”, then kindly contact us.
Want to add an alternate method: If anyone wants to add more methods to the guide How to Enable PHP in Apache for Mac OS X Yosemite & Mavericks, then kindly contact us.
Our Contact: Kindly use our contact page regards any help.

James Hogan
James Hogan is a senior staff writer at Bollyinside, where he has been covering various topics, including laptops, gaming gear, keyboards, storage, and more. During that period, they evaluated hundreds of laptops and thousands of accessories and built a collection of entirely too many mechanical keyboards for their own use.

RELATED ARTICLES

Must Read

- Advertisment -