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