Data-id= "1190000004873405" >
Application areas of PHP
Web server-side scripting: the main role
Application graphical interface
Command-line scripting
php.exe -f "php文件路径"
Orphp.exe -r "php脚本代码"
Installing Apache
Open the installer all the way next
Install PHP
Unzip the PHP package into a directory in the system
Install MySQL
The default option is all the way next.
Configuring Apache and PHP
Open Apache httpd.conf file to add the following
LoadModule php5_module "php解压目录中找到 php5apache2_2.dll的路径"
Add the following content
AddType application/x-httpd-php .php .pap .phtml
Detecting Apache Configuration syntax
httpd.exe -t
PHP Configuration Time Zone
Open PHP Unzip directory to find php.ini file
Find keywords timezone
and uncomment to change todate.timezone = PRC
To set the php.ini file path in httpd.conf
PHPIniDir 'php解压目录'
Restart Apache
PHP configuration MySQL
Find Uncomment in php.ini extension_dir
Find a comment that cancels php_mysql.dll
a comment at the same time in php.ini mysqli.dll
Apache Host Configuration
Directory Access Permission Description
#设置当一个请求中没有给定请求的文件名又没有默认网页(首页)的时候,显示文件列表Options Indexes #设置权限控制的先后顺序,只有2种:Deny,Allow(先拒绝,后允许),Allow,Deny(先允许后拒绝)Order Deny,Allow#Deny用于设定要拒绝访问的来源地址或服务器名,几乎没有实际意义!Deny from 拒绝名单 比如:deny from 192.168.3.8 172.180.4Allow from 允许名单 比如:Allow from all#设置该文件夹下的“默认网页”(首页),可以设置多个,用于请求中不带文件名的时候自动使用该文件作为“返回”页面。DirectoryIndex index.php index.html main.php default.php abc.php 123.html# 允许分布权限AllowOverride all
Distribution permissions are the permissions to set the folder individually without restarting Apache. Create a new. htaccess file in a folder that requires separate configuration permissions, as follows
Deny from all
Apache Virtual Host Configuration
In the Apache Master Profile httpd.conf, open the multisite Virtual host profile entry (keyword: vhosts):
In the httpd-vhosts.conf file, set the IP address and port number that you want to provide the "multisite" service, usually by default:: 80, where "" means all IPs, the default is actually Apache installed after the set up, No manual setup required (keyword Namevirtualhost):
Configure each individual site
#主机名ServerName www.baidu.com#主机别名ServerAlias map.baidu.com tv.baidu.com#目录DocumentRoot "C:/root"#目录权限配置
Options Indexes Order Deny,Allow Allow from all
#虚拟目录Alias /abc 'C:/alias'
Options Indexes Order Deny,Allow Allow from all
The above describes the 2016-04-05, including 2016 aspects of the content, I hope that the PHP tutorial interested in a friend helpful.