OSXMountainLion enables apache and php

Source: Internet
Author: User
1. First enable the root user SystemPreferencesUsersandGroups lower left Loginoptions lower right corner joinOpenDirectoryutility... setting root Password 2. Enable PHPOSXMountainLion pre-installed PHP5.3.13 but not enabled by default. Enable T

1. first, enable the root user System Preferences Users and Groups to join Open Directory utility in the lower-left Login options lower-right corner .... edit menu in top menu Enable root user. set the root password 2. enable php OS X Mountain Lion with PHP 5.3.13 preinstalled but not enabled by default.

1. FirstEnableRoot User

System Preferences

Users and Groups

Login options in the lower left corner

Join in the lower right corner

Open Directory utility ....

Edit menu in top menu

Enable root user.

Set root Password


2.EnablePHP

OS X Mountain Lion is pre-installed with PHP 5.3.13 but is not enabled by default,

Open Terminal,

Enter sudo nano/etc/apache2/httpd. conf to edit httpd. conf,

Search for php by Control + W and find: # LoadModule php5_module libexec/apache2/libphp5.so,

Remove the # Before this line,

Control + O save,

Control + X exit,

Return to the terminal and enter:

Login root

Enter Password

Enter apachectl restart,

PHP has been enabled properly,

3. Edit the php source code.

You can upload a PHP file named at will under the Library/WebServer/Documents directory,

For example, enter info. php In this php file. ,

Then access "localhost/info. php" in the browser ",

The detailed php configuration environment information is displayed.

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.