当前位置:网站首页>Configure PHP development environment in MAC environment: apache+php+mysql
Configure PHP development environment in MAC environment: apache+php+mysql
2022-06-24 06:14:00 【User 1685462】
One 、 start-up Apache
1、 Open the terminal , Input
sudo apachectl start
You need to enter the password , Enter the computer password , Then input
sudo apachectl -v
You can see that Apache Version information for
Server version: Apache/2.4.23 (Unix) Server built: Aug 8 2016 16:31:34
Enter... In the browser http://localhost, There will be It works! The page of
Two 、 function PHP
1、 find Apache Configuration file for , In the catalog /etc/apache2/ Next , open Finder, choice " Go to "-" Go to folder ", Input "/etc/apache2/", Find one "httpd.conf" file , Select open with document for editing , Click Command+F, Search for #LoadModule php5_module libexec/apache2/libphp5.so, Pictured
Put the blue line # Remove the number , Then save , If text lock occurs , Unable to unlock , Copy the file to the desktop , Make changes , After modification, copy to the original folder to replace the previous file .
2、 restart Apache, Input... At the terminal
sudo apachectl restart
PHP You can use it .
3、 Input... At the terminal
sudo cp /Library/WebServer/Documents/index.html.en /Library/WebServer/Documents/info.php
That is to say Apache Copy under the root directory of index.html.en And rename it to file info.php.
4、 open info.php, stay It works Followed by , And then restart again Apache, Enter... In the browser http://localhost/info.php, A display will appear php Information page , As shown in the figure .
3、 ... and 、 To configure MySql
1、 stay http://dev.mysql.com/downloads/mysql/ On the website , choice Mac OS X platform , Then select download... In the figure , I started downloading wrong , Installation error , Later, the version in the figure was downloaded and installed successfully
double-click dmg file
Double click installation
2、 Change Password
a) First stop MySQL service
open “ System preferences ”, choice “MySQL”, Click... In the open dialog box “Stop MySQL Server”
Input... At the terminal , Change the password here to 12345, It can also be used for other , Customize it
b) Open the terminal , Enter the command :sudo /usr/local/mysql/bin/mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
--skip-grant-tables: Do not start grant-tables( Authorization Form ), Skip access control .
--skip-networking : skip TCP/IP agreement , Only on the local machine ( This option is not required . Don't have to )
sudo /usr/local/mysql/bin/mysqld_safe --user=mysql --skip-grant-tables
c) Enter the command :/usr/local/mysql/bin/mysql
/usr/local/mysql/bin/mysql
At this point, we can log in directly to MySQL Yes .
The terminal can change the password by entering the command
/usr/local/mysql/bin/mysqladmin -u root password 123456
Four 、 Use phpMyAdmin
phpMyAdmin Yes, it is PHP Development management MySql The program , Very practical
1、 download phpMyAdmin, On the website Downloads Select the appropriate version to download , I chose phpMyAdmin-4.6.5.2-All-Languages.tar.bz2
2、 Unzip the downloaded file , In the /Library/WebServer/Documents/ In the folder , And named it phpmyadmin.
3、 Copy /Library/WebServer/Documents/phpmyadmin Medium config.sample.inc.php, And named it config.inc.php, And put it in the current folder .
4、 edit config.inc.php, Modify the
$cfg['Servers']]$i]['host'] = 'localhost';
by
$cfg['Servers']]$i]['host'] = '127.0.0.1';
that will do , If you want to log in without password , In the following statements false Change to true
$cfg['Servers'][$i]['AllowNoPassword'] = false
5、 Enter... In the browser http://localhost/phpmyadmin, enter one user name "root", And the password you just changed , If the password has not been changed , Then follow the no password operation in the previous step , Then you can log in directly .
边栏推荐
- CLB unable to access / access timeout troubleshooting
- Why migrate dig to wire
- Excel data extraction technique: a universal formula for extracting numbers from mixed text
- How to buy a domain name? How to do a good job in website construction?
- The errorcontrol registry of the third-party service is 3, which may cause the system to cycle restart. For example, ldpkit introduced by WPS
- Analysis of official template of micro build low code (I)
- How to solve the problem that easynvr calls the video download interface of the specified time period to display "being synthesized" and does not generate video?
- System of test development - create test virtual machine on demand
- Test development knowledge map
- Easycvr is cascaded to easygbs through gb28181 protocol. Notes on video channel failure
猜你喜欢

What is the difference between a white box test and a black box test

A cigarette of time to talk with you about how novices transform from functional testing to advanced automated testing
![[fault announcement] one stored procedure brings down the entire database](/img/7c/e5adda73a077fe4b8f04b59d1e0e1e.jpg)
[fault announcement] one stored procedure brings down the entire database

Technology is a double-edged sword, which needs to be well kept

Solution to the 39th weekly game of acwing

ServiceStack. Source code analysis of redis (connection and connection pool)

One line of keyboard
随机推荐
Event delegation
Is IPFs a new national infrastructure project? What impact will the new infrastructure have on IPFs?
Royal treasure: physical storage medium
Sub process call - process arrangement in complex O & M scenarios
Little transparent apprentice's way to go ashore
As a sigmastar agent, Qiming cloud shares dry goods for you: what are the characteristics of ssd201/202
The errorcontrol registry of the third-party service is 3, which may cause the system to cycle restart. For example, ldpkit introduced by WPS
Multi objective Optimization Practice Based on esmm model -- shopping mall
Summary of basic notes of C language (2)
Container lifecycle
PNAs: development of white matter pathways in human brain during the second and third trimester of pregnancy
How do fixed assets intensive enterprises manage fixed assets effectively?
New tea: reshuffle, transformation, merger and acquisition
New core and new speed - next generation standard O & M engine
Experience sharing on unified management and construction of virtual machine
Continuously evolving cloud native application delivery
Brief introduction to the working principle of high frequency signal generator
Why migrate dig to wire
Text classification and fine tuning using transformer Bert pre training model
The influence of TLS protocol and cipher on remote RDP