Mac comes with Apache and PHP

Source: Internet
Author: User



MAC is installed by default Apache and PHP, but need to use root user to enable, so follow my steps below to:

First, enable the root user
1. Select System Preferences ....
2. From the Display menu, choose Account.
3. Tap the lock icon and enter using the administrator account.
4. Click "Login Options".
5. Click the "Join" button at the bottom right.
6. Click on the "Open Directory Utility" button.
7. Click the lock icon in the Catalog Utility window.
8. Enter the Administrator account name and password, then click OK.
9. From the Edit menu, choose Enable Root user.
10. Enter the root password you want to use in the "password" and "Verify" fields, then click "OK"

Second, enable Apache
1. Enter the terminal application--utility--terminal
2. Enter SU return
3. Enter the root password
4. Start Apache, enter command apachectl start
5. Apache's home directory is:/libary/webserver/documents/
6. Open the browser input: HTTP://127.0.0.1/can see the output: it works!

Third, let Apache support PHP
1, command line input: vi/etc/apache2/httpd.conf
2, modify #loadmodule php5_module libexec/apache2/libphp5.so
Erase the #


3, command line input: Cp/etc/php.ini.default/etc/php.ini
4. Restart Apache
Apachectl restart
5. Create a new file in the/libary/webserver/documents/directory index.php to test whether PHP supports
Input:

<?php
Phpinfo ();
?>
6, enter in the browser: http://127.0.0.1/index.php if correct, you can output PHP information

Mac comes with Apache and PHP

Related Article

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.