Install and configure Apache & PHP + Xdebug

Source: Internet
Author: User
: 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

  1. Go to the official website and openDownload pageDownload the latest compressed package;
  2. Decompress the package to the directory you want to install.F:\Program Files\ApacheMedium;
  3. EnterF:\Program Files\Apache\confDirectory, open the editorhttpd.confFile. 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: ->
  4. 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

  1. Go to the official website and goDownloadFind the download link and download the compressed package;
  2. Decompress the package to the directory you want to install.F:\Program Files\phpMedium;
  3. EnterF:\Program Files\phpDirectory, setphp.ini-developmentRenamephp.iniAnd 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 892Add:extension=php_mysqli.dll
  4. Go to the xdebug official website and openDownload pageDownload the dll files of the corresponding system and PHP versions;
  5. Put the downloaded dllF:\Program Files\php\extMedium;
  6. Edit againphp.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"
  7. Install the easiest Xdebug plug-in firefox;
  8. Start phpstorm's microphone monitoring;
  9. Start xdebug plug-in
  10. 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.