First, install the Appache
\conf\httpd.conf
The Htdocs folder under the installation directory is the Web site file directory. or modify the DocumentRoot parameter in the conf/httpd.conf file in the Apache installation directory to specify the directory, as
DocumentRoot = "E:/compiler/apache/htdocs"
2. Access error "You do not have permission to access/on this server."
If there is an error during access "You don't have permission to access/on
This server. ", modify conf/httpd.conf in
----------------------------------------
<directory/>
Options FollowSymLinks
Options FollowSymLinks
AllowOverride None
Order Deny,allow
Deny from all
</Directory>
----------------------------------------
The Deny from all is changed to allow.
3. Directory mode access
The options followsymlinks in the table above indicate that directory access is forbidden. Change to Options Indexes followsymlinks to enable directory-mode access.
Most of the times we use the Http.exe command to install, open, stop, delete Apache services these operations.
Httpd-k Install
Register Apache as a Windows service because we are using the apache2.2 version, so the default service name is "Apache2.2".
Httpd-k install-n "Service Name"
Register Apache as a Windows service and specify a service name yourself.
Httpd-k install-n "service name"-F "conf\my.conf"
Register Apache as a Windows service, specify a service name yourself, and use a specific configuration file.
Httpd-k Uninstall
The Apache service is removed, and by default, "Apache2.2" will be used
Httpd-k uninstall-n "Service Name"
Remove the Apache service and make a service name yourself.
Httpd-k start
Start the Apache service.
Httpd-k stop
Stop the Apache service.
Httpd-k restart
Restart the Apache service.
Second, install PHP
Iii. Integration of Apache+php+mysql
Apache: First modify the Apache configuration file, let Apache support parsing php files. Apache configuration files are httpd.conf in the Conf directory of the Apache installation directory.
1. Allow Apache to parse the PHP file and locate it in the configuration file
#LoadModule Vhost_alias_module modules/mod_vhost_alias.so
Add on the next line (the green location is based on the directory where PHP is located)
LoadModule php5_module "D:/develop/php/php5apache2_2.dll"
Phpinidir "d:/develop/php"
AddType application/x-httpd-php. php. html. htm
2. Found in the configuration file
DirectoryIndex index.html
Switch
DirectoryIndex index.php index.html
3. Modify the Apache Site Directory, found in the configuration file (Apache installed directory, different values displayed)
DocumentRoot "D:/develop/apache2.2/htdocs"
Switch
DocumentRoot "d:/workspace/php"
Find it again.
<directory "D:/develop/apache2.2/htdocs" >
Switch
<directory "d:/workspace/php" >
PHP: Renamed Php.ini-development to php.ini as a PHP configuration file. Modify PHP.ini
1. Set the specific directory for the PHP expansion pack to find
; On Windows:
; Extension_dir = "ext"
Change to (value is the directory of Ext folder)
; On Windows:
Extension_dir = "D:/develop/php/ext"
2. Turn on the library function to locate the row of the library you want to open
; Extension=php_curl.dll
; Extension=php_gd2.dll
; Extension=php_mbstring.dll
; Extension=php_mysql.dll
; Extension=php_xmlrpc.dll
Remove the preceding semicolon (note) and change to
Extension=php_curl.dll
Extension=php_gd2.dll
Extension=php_mbstring.dll
Extension=php_mysql.dll
Extension=php_xmlrpc.dll
3. Set the time zone to find
;d Ate.timezone =
Switch
Date.timezone = Asia/shanghai
Configuration is complete to detect the success of the configuration. Restart Apache, in the Site directory, create a new file index.php, enter the content:
<?php
Phpinfo ();
?>
Open the browser input http://localhost, display the following content, the installation was successful, and successfully associated with MySQL.
Four: Xdebug
To the official website http://www.xdebug.com/download.php download
Find the corresponding PHP version of the Xdebug, behind the thread-safe with TS, the native environment is Win7 + php-5.5.1-win32-vc11-x64, the download is Xdebug 2.3.3 PHP 5.5 VC11 TS (with a bit)
Installation:
Win: Place the downloaded DLL file (this is Php_xdebug-2.3.3-5.5-vc11-x86_64.dll) in the Ext folder of the PHP installation directory. This machine is put in D:\ApacheServer\php\ext\
Create a new Xdebug folder under Apacheserver and create a new trace and Profiler folder under Xdebug to store the two types of information generated by Xdebug
Edit PHP.ini, add the following lines
Zend_extension = "D:\ApacheServer\php\ext\php_xdebug-2.3.3-5.5-vc11-x86_64.dll"
; Allow Remote IDE debugging
Xdebug.remote_enable = True
; Remote host
Xdebug.remote_host = 127.0.0.1
; xdebug.remote_port = 9000; default Port 9000
Xdebug.profiler_enable = On
Temporary Trace information output
Xdebug.trace_output_dir = "D:\ApacheServer\xdebug\trace"
Xdebug.profiler_output_dir = "D:\ApacheServer\xdebug\profiler"
; The remaining parameters
; Turn on automatic tracking. Automatically turns on the "monitor function call process" mode. This function can output the monitoring information of a function call as a file in the directory you specify
Xdebug.auto_trace = On
; Turn on exception tracking
Xdebug.show_exception_trace = On
; Turn on remote debugging auto-start
Xdebug.remote_autostart = On
; Collecting variables
Xdebug.collect_vars = On
; Collect return values
Xdebug.collect_return = On
; Collect parameters
Xdebug.collect_params = On
; Show local variables
Xdebug.show_local_vars = On
; Displays the default error message
Xdebug.default_enable = On
: Application-Layer communication protocol for Zend Studio remote debugging
Xdebug.remote_handler = DBGP
If it is set too small, there is a recursive call to itself too many times in the function to report more than the maximum number of nested errors
Xdebug.max_nesting_level = 10000
Zend_extension = "D:\ApacheServer\php\ext\php_xdebug-2.3.3-5.5-vc11-x86_64.dll" is the same as Zend Debugger
Different systems and PHP versions have different wording
Linux and Mac OS x:zend_extension = "D:\ApacheServer\php\ext\php_xdebug-2.3.3-5.5-vc11-x86_64.dll"
Windows thread-safe Version php:zend_extension_ts = "D:\ApacheServer\php\ext\php_xdebug-2.3.3-5.5-vc11-x86_64.dll"
Windows non-thread-safe Version php:zend_extension = "D:\ApacheServer\php\ext\php_xdebug-2.3.3-5.5-vc11-x86_64.dll"
So the same server can only load one debugging tool, either Zend Debugger or Xdebug
But in the PHP5.5 environment test, thread-safe version of PHP can not add _ts can only be written zend_extension =
Xdebug.profiler_enable = ON and the following directory "D:\ApacheServer\xdebug" function is to open the execution of the analysis file to the specified directory functions, can be set freely. You don't write.
Generated files, such as cachegrind.out.4408 files named in this format, can be opened with the editor to see details about how many programs run
Restart Apache
Restart
Write a program that can cause an error to occur, such as trying to include a file that does not exist.
<?php
Require ' abc.php ';
?>
Then through the browser access, surprised to find that the error message has become color, and Xdebug tracking code execution
Zend Studio Settings
Zend Studio 10.6.2
Apache2.4.4
Modify Zend Studio Settings
window->preferences->php->php Executables->add
Fill in the content as follows, executable path Select file after php INI file (optional) Automatically assigned value
name:php 5.5.1_CLI
Executable Path:d:\apacheserver\php\php.exe
PHP INI file (optional): D:\ApacheServer\php\php.ini
SAPI TYPE:CLI
PHP Debugger:xdebug
Click Finish to save automatically is the default
(If you only need CLI debugging this step can be ignored) Click the PHP Server drop-down box on the default PHP Web server to the right of PHP Servers ...
Select name| URL list, click Edit on the right
In the Debugger drop-down box of the popup box, select Xdebug
Start debugging
Double-click on the left row column in your code to add a breakpoint
Run->debug configurations ...
Double-click PHP CLI Application
Enter the name you want, click Browse on the right side of the PHP file, select the file you want to debug, and click Apply below.
or open the page you want to run
Run->debug as->php CLI Application
That is, you can run in debug mode, or you can choose other debug modes other than CLI
Click the down arrow on the toolbar (Step into) or press F5 to line it up. Click the green right arrow on the left (Resume) or press F8 to continue until you stop at the breakpoint
Click the red button (Terminate) to finish debugging, then click the Bug button to start debugging again
NetBeans
1, modify the php.ini
[Xdebug] (enclosed in brackets is the module name, which is displayed in your phpinfo message as a large, delimited title.)
Zend_extension=d:/php/ext/php_xdebug-2.2.1-5.4-vc9.dll
Xdebug.remote_enable=on
Xdebug.remote_handler=dbgp
Xdebug.remote_host=localhost
xdebug.remote_port=9000
Set up NetBeans below to start
Tools, Options, general select Good web browser tools, options->php-> debugging
See if the port is correct the next step is to open the file you want to debug, set a breakpoint (you can also set or modify breakpoints during debugging).
During the debugging process, you can look at the various variables in the execution process.
PHP 5.2.17
Then write the following in the php.ini file:
Zend_extension_ts= "D:\wamp\php\php_xdebug.dll"; This path must be written right.
Xdebug.trace_output_dir= "D:\wamp\xdebug\trace"
Xdebug.profiler_output_dir= "D:\wamp\xdebug\profiler"
Xdebug.auto_trace=on; automatically turn on the "monitor function call process" mode
Xdebug.collect_params=on; Open the function that collects function parameters
Xdebug.collect_return=on. Turn on the function that collects the function return value
Xdebug.profiler_enable=on; open the Performance Monitor.
You can start it later.
Be sure to turn off the Zendoptimizer feature
Php+apache Configuration