Open Apache First, enter the localhost return on the browser if the screen is displayed: It works! Such as:
This means your Apache is open.
To configure Apache under window:
1. Locate the http.conf file in the Apache installation directory to open this profile
2. Search the file for LoadModule Php5_module Remove the previous # number and change the path to the PHP installation path/php5apache2_2.dll
3. Search Directory To change the following two paths to the folder where the project is located
4. Create a new file in the project folder directory above and write it in:
<?php
Echo Phpinfo ();
?>
Access the file in a browser to see
Mac Apache Configuration (Mac comes with Apache, PHP, UNIX (with integrated Linux))
1. Open Apache
In the terminal, enter:
sudo apachectl start Enter, terminal prompt input password, enter and then return to
After entering localhost carriage return in the browser, see
This means that Apache is open for success.
2. Press Shift+command+g to enter/etc to find the Apache2 folder
After entering, locate the Apache configuration file httpd.conf
Found it:
Remove the # in front of this line
3. Customizing a Folder
Search <Directory>
Change the path of the red box above to a custom folder path
3. Restart after saving
Command:sudo apachectl–restart
After the carriage return, build a PHP file in the custom directory with the following contents:
<?
Echo Phpinfo ();
?>
Then you can see the information about PHP
However, in some cases, using a framework-written project, you need to turn on the server virtual machine, specifically pointing to this project step as follows:
An item written in thinkphp (because the link path has been processed internally, and cannot be entered directly) to open the Apache virtual machine:
1. Go to the below Apache installation folder under etc
2. Locate the httpd.conf file
Find LoadModule Reqtimeout_module libexec/apache2/mod_reqtimeout.so the front #
Find include/private/etc/apache2/extra/httpd-vhosts.conf and remove the previous #
Find all allowoverride and change denied to all
3. Go to the Extra folder to locate the httpd-vhosts.conf file
Then create a new segment (note The default 80 port do not change)
Listen 81
<virtualhost *:81>
ServerAdmin [email protected]
DocumentRoot "/users/pingguo/php/excourse"
ServerName localhost
Serveralias www.dummy-host.example.com
Errorlog "/private/var/log/apache2/excourse-error_log"
Customlog "/private/var/log/apache2/excourse-access_log" common
</VirtualHost>
The following path is the project path:
DocumentRoot "/users/pingguo/php/excourse"
And then restart Apache, then you can.
Apache command:
Open Apache sudo apachectl start
View Apache version of : sudo apachectl-v
Close apache:sudo apachectl Stop
Restart Apache:sudo Apachectl–restart
Install MySQL under Mac:
Download MySQL DMG version of
Double-click Open, double-click Install, then Next, Next, install
During the installation process, a window will be redirected with the default password (
Links: http://fromwiz.com/share/s/2mEs1J3ZIAR323l-hM0_sVmG2ZrD5W0aEQjA23dNvK3FrKms
Password: 49x6
Please record the above information.
When the installation is complete, enter the local database with Workbench
Sometimes you need to change the port number to 3307
Password Enter the default password above
After the input, you will be able to reset the database password, enter a new password, set the success of the new password can be entered into the database
Recommended MySQL Command Window on Mac: Oh-my-zsh when you build a database, you should set the character set to UTF8 defaultcollection, otherwise the database may not plug in the Chinese character metabase password: Skip database Password 1. Edit/etc/my.cnf (if not, copy the/USR/LOCAL/MYSQL/SUPPORT-FILES/MY-DEFAULT.CNF (system root) file and modify it to MY.CNF) 2. Add a line in the configuration section: Skip-grant-tables3. Restart MySQL mysql environment variable configuration after saving: (Baidu)
Open terminal, input: cd ~
Will enter the ~ folder
Then type: sudo vim. bash_profile
Enter the root user password to execute. sudo uses the root user to modify the environment variable file.
Enter at the bottom of the document: Export Path=${path}:/usr/local/mysql/bin
Then ESC exits the insert state and enters at the bottom: Wq save to exit.
Input: source. bash_profile
Enter execution, run environment variable.
Then enter MySQL and you can use it.
Windows and Mac configuration Apache, and Mac install MySQL