Home > Backend Development > PHP Tutorial > PHP environment setup, PHP setup_PHP tutorial

PHP environment setup, PHP setup_PHP tutorial

WBOY
Release: 2016-07-13 09:56:49
Original
905 people have browsed it

php environment setup, php setup

1. Prepare the required tools:

1) Windows7 x64

2) php5.5 VC11 x64 Thread Safe Browsing

3) apache httpd2.4 browsing

4) MySQL5.6 Browse

5) phpMyAdmin4.4.1 Browse

2. Installation

2.1 Install PHP

 1) Unzip php-5.5.23-Win32-VC11-x64.zip to D:program_filesphp5.5

 2) Add D:program_filesphp5.5 and D:program_filesphp5.5ext to the environment variables

 3) Copy php.ini-production to php.ini

 4) Modify the D:program_filesphp5.5php.ini file

修改 <span>;</span><span> extension_dir = "ext"</span>
<span>extension_dir = "D:/program_files/php5.5/ext"

修改 </span><span>;</span><span>extension=php_mbstring.dll</span>
extension=<span>php_mbstring.dll (php多字节字符串扩展)

修改 </span><span>;</span><span>extension=php_mysql.dll</span>
extension=<span>php_mysql.dll

修改 </span><span>;</span><span>extension=php_mysqli.dll</span>
extension=php_mysqli.dll  
Copy after login

2.2 Install Apache

 1) Unzip httpd-2.4.12-win64-VC11.zip to D:program_filesApache24

 2) Open D:program_filesApache24conf with notepad and modify

 

修改 ServerRoot "C:/Apache24"<br />ServerRoot "D:/program_files/Apache24"<br /><br /><span>修改 #ServerName www.example.com:80
ServerName www.example.com:</span>80<span>

修改 DocumentRoot </span>"c:/Apache24/htdocs"<span>
DocumentRoot </span>"D:/program_files/Apache24/htdocs"<span>

修改 <Directory </span>"c:/Apache24/htdocs"<span>>
<Directory </span>"D:/program_files/Apache24/htdocs"<span>>

修改 DirectoryIndex index.html
DirectoryIndex index.html index.php index.htm

修改 ScriptAlias /cgi-bin/ </span>"c:/Apache24/cgi-bin/"<span>
ScriptAlias /cgi-bin/ </span>"D:/program_files/Apache24/cgi-bin/"
Copy after login

Add

at the end of the line

AddType application/x-httpd-php .php .html .htm
LoadModule php5_module "D:/program_files/php5.5/php5apache2_4.dll"

PHPIniDir "D:/program_files/php5.5"

 3) Install and start the apache service (administrator rights required)

D:\program_files\Apache24\bin\httpd -k <span>install<br />net start apache2.4</span>
Copy after login

 4) Enter http://localhost:80

in the browser
It works!
Copy after login
2.3 Install MySQL

 1) Unzip mysql-5.6.24-winx64.zip to D:program_filesMySQL5.6

2) Copy my-default.ini to my.ini and modify

Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.

Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login

[mysqld]

Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login

# These are commonly set, remove the # and set as required.
basedir = D:/program_files/MySQL5.6
datadir = D:/program_files/MySQL5.6/data
port = 3306
server_id = 1

Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login


# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M

Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

 3) Start MySQL

D:/program_files/MySQL5.<span>6</span>/bin/mysqld.exe --console
Copy after login

 4) Log in to the MySQL database and create a user

mysql -u root<br /><br />CREATE USER 'devlop'@'localhost' IDENTIFIED BY '123456';<br />GRANT ALL PRIVILEGES ON *.* TO 'devlop'@'localhost' WITH GRANT OPTION;
Copy after login

Click here for more MySQL user management

5) Install and start the MySQL service (administrator rights required)

mysqld --<span>install</span> MySQL<br />net start MySQL
Copy after login
2.4 Install phpMyAdmin

 1) Unzip phpMyAdmin-4.4.1.1-all-languages.zip to D:program_filesApache24htdocsphpMyAdmin

 2) Enter http://localhost:80/phpMyAdmin in the browser to log in to MySQL.

If you have any questions, please contact QQ directly: 783713515

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/985693.htmlTechArticlephp environment setup, php setup 1. Prepare the required tools: 1) Windows7 x64 2) php5.5VC11 x64 Thread Safe browsing 3) apache httpd2.4 browsing 4) MySQL5.6 browsing 5) phpMyAdmin4.4.1 browsing 2. Install...
Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template