: This article mainly introduces the installation and configuration of Apache & PHP + Xdebug. if you are interested in the PHP Tutorial, refer to it. Recently, I have to start using PHP for development. I have to check every time how to install and configure the environment. it is still annoying to write in different places. Write by yourself.
Apache
- Go to the official website and open
Download page
Download the latest compressed package;
- Decompress the package to the directory you want to install.
F:\Program Files\Apache
Medium;
- Enter
F:\Program Files\Apache\conf
Directory, open the editorhttpd.conf
File. Modify the following parts:
line 37: ServerRoot "c:/Apache24" -> ServerRoot "F:/Program Files/Apache"
line 58: Listen 80 -> Listen 8080
line 218: ServerName www.example.com:80 -> ServerName www.example.com:8080
line 242: DocumentRoot "c:/Apache24/htdocs" -> DocumentRoot "F:/Projects/php"
line 243: ->
line 276: DirectoryIndex index.html -> DirectoryIndex index.php index.htm index.html
line 359: ScriptAlias /cgi-bin/ "c:/Apache24/cgi-bin/" -> ScriptAlias /cgi-bin/ "F:/Program Files/Apache/cgi-bin"
line 375: ->
- Add the following content to the end of the file:
# php5 support
LoadModule php5_module "F:/Program Files/php/php5apache2_4.dll"
PHPIniDir "F:\Program Files\php"
AddType application/x-httpd-php .php .html .htm
# configure thepath to php.ini
In this way, Apache configuration is complete.
PHP
- Go to the official website and go
Download
Find the download link and download the compressed package;
- Decompress the package to the directory you want to install.
F:\Program Files\php
Medium;
- Enter
F:\Program Files\php
Directory, setphp.ini-development
Renamephp.ini
And open the file in the editor. Modify the following parts:
line 736: extension_dir = "ext" -> extension_dir = "F:/Program Files/php/ext"
line 807: upload_tmp_dir = -> upload_tmp_dir = "/upload-files"
line 881: ;extension=php_curl.dll -> extension=php_curl.dll
line 883: ;extension=php_gd2.dll -> extension=php_gd2.dll
line 890: ;extension=php_mbstring.dll -> extension=php_mbstring.dll
line 892: ;extension=php_mysql.dll -> extension=php_mysql.dll
line 895: ;extension=php_openssl.dll -> extension=php_openssl.dll
line 897: ;extension=php_pdo_mysql.dll -> extension=php_pdo_mysql.dll
line 899: ;extension=php_pdo_odbc.dll -> extension=php_pdo_odbc.dll
line 915: ;extension=php_xmlrpc.dll -> extension=php_xmlrpc.dll
line 930: ;date.timezone = -> date.timezone = Asia/Chongqing
line 1417: ;session.save_path = "/tmp" -> session.save_path = "/session"
Andline 892
Add:extension=php_mysqli.dll
- Go to the xdebug official website and open
Download page
Download the dll files of the corresponding system and PHP versions;
- Put the downloaded dll
F:\Program Files\php\ext
Medium;
- Edit again
php.ini
, Add the following content at the end of the file:
[XDebug]
zend_extension = "F:\Program Files\php\ext\php_xdebug-2.3.3-5.6-vc11-x86_64.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "F:\Program Files\php\xdebug"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.trace_output_dir = "F:\Program Files\php\xdebug"
- Install the easiest Xdebug plug-in firefox;
- Start phpstorm's microphone monitoring;
- Start xdebug plug-in
- Set the program debugging breakpoint.
So far, the configuration is complete. MySQL is too simple to write.
The above introduces the installation and configuration of Apache & PHP + Xdebug, including some content, and hope to be helpful to friends who are interested in PHP tutorials.