Home > Backend Development > PHP Tutorial > Configuring Apache + PHP + MySQL_PHP tutorial in Mac OS X

Configuring Apache + PHP + MySQL_PHP tutorial in Mac OS X

WBOY
Release: 2016-07-20 11:15:46
Original
943 people have browsed it

. This article takes Mac OS X 10.6.3 and 10.8.1 as examples. The main contents include:

!", which is located in "/Library (resource library)/ WebServer/Documents/", this is the default root directory of Apache .

through "http://[Local IP]/~[User Name]". It is worth noting that when Mac OS X canceled "Web Sharing" in 10.8, it also removed the "/Users/[username]/Sites/" directory, so 10.Accessing "http://[local IP]/~[username]" in 8 will display "403 Forbidden", but http://[local IP]/ can still be accessed. You can go to "System Preferences" -> "Security" -> "Firewall", turn on the firewall, and then check "Organization" in "Firewall Options" "block all incoming connections" can be done . You can also set httpd.conf to only allow localhost and 127.0.0.1 to access "/Library/WebServer/Documents/".

<span <code><Directory "/Library/WebServer/Documents">
    ......
    #
    # Controls who can get stuff from this server<strong>.</strong>
    #
    Order allow,deny
    #Allow from all
    Allow from 127<strong>.</strong>0.0<strong>.</strong>1
    Allow from localhost 

</Directory>
</code></span>
Copy after login

.5. MySQL provides installation instructions under Mac OS X.

Warning: The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql' ", this should be caused by some circumstances /usr/local The host of /mysql/data<code>/usr/local/mysql/data has changed, just run "sudo chown -R mysql /usr/local/mysql/data<code>sudo chown -R mysql /usr/local/mysql/data" <. 🎜> .

0.0.1. The reason is that php looks for /var/mysql/mysql.sock<strong> by default when connecting, but the MAC version of MYSQL has changed the file location and placed it in / tmp downloaded </strong>. <code>/var/mysql/mysql.sockThe solution is to modify php.ini as follows:

<span <code>mysql.default_socket = /tmp/mysql.sock</code></span>
Copy after login

.

Being able to use phpMyAdmin to manage MySQL is a very effective way to test the effects of the previous steps.

Extension .

But the installation under Mac OS X is not so friendly, as follows:

http://localhost/phpmyadmin

, you will find that the "mcrypt extension cannot be loaded, please check your PHP configuration ." prompt is gone, which means the MCrypt extension library The installation was successful. If it still cannot be loaded, try changing the extension<strong> added in php.ini to: </strong><code>extension

<span <code>extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/mcrypt<strong>.</strong>so</code></span>
Copy after login

.6.3 and 10.8.1. You can also refer to "Mac OS , and phpMyAdmin(1)” and “Mac OS X Leopard: Configuring Apache, PHP, SQLite, MySQL, and phpMyAdmin(2)”.

In fact, you can also use third-party integration solutions such as XAMPP or MacPorts to achieve simple installation and use.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/440155.htmlTechArticle. This article takes Mac OS X 10.6.3 and 10.8.1 as examples. The main content includes: ! page, which is located under /Library (resource library)/WebServer/Documents/, which is the default root directory of Apache. ...
source:php.cn
Previous article:php object tool_PHP tutorial Next article:WeChat public platform development (7) Chat robot function development_PHP tutorial
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Latest Issues
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template