Let PHP run in Mac OS X

Source: Internet
Author: User

MacBook Start, configure the working environment, first let Mac OS support PHP. Whether you're using an integrated development environment, such as XAMPP for Mac OS X, or using Apache and PHP, which comes with Mac OS, or even recompiling your installation yourself, the first step in reducing the hassle is to enable the root user.

This article uses the Mac OS X 10.5.6 with Apache and PHP, install the MySQL version of DMG, the following non-special instructions are the root user at the command line.

Enable root user
1. Open the Directory utility, which is located in the Utilities folder of the Applications folder. (In the/system/library/coreservices directory, or directly execute the following command open-a "directory Utility")
2. Tap the lock icon to make changes. You will need to enter an administrator name and password.
3. Choose "Edit" > "Enable Root User".
4. Enter the security password for the root user, and then enter it again in the validation bar, and finally click OK.

Enable Apache
Mac OS X 10.5.6 comes with Apache 2.2.9 and runs Apachectl Start,apache directly on the command line.

Now Apache's home directory is/libary/webserver/documents/, you can put the file test in this directory.

Enable PHP
Mac OS X 10.5.6 comes with PHP 5.2.6, and all we need to do is add PHP to Apache.

Modify the/etc/apache2/httpd.conf in the
#loadModule Php5_module libexec/apache2/libphp5.so
For
LoadModule Php5_module libexec/apache2/libphp5.so

Then copy the/etc/php.ini.default to/etc/php.ini.
Cp/etc/php.ini.default/etc/php.ini

After that, you can modify the php.ini configuration according to your own habits.
For example, error_reporting = E_all & ~e_notice
Revision changed to
error_reporting = E_all

Finally, to restart Apache, you can set up a phpinfo.php in the/libary/webserver/documents/directory to test it.
sudo apachectl restart

Let PHP run in Mac OS X

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.