<i id='yjMFw'><tr id='yjMFw'><dt id='yjMFw'><q id='yjMFw'><span id='yjMFw'><b id='yjMFw'><form id='yjMFw'><ins id='yjMFw'></ins><ul id='yjMFw'></ul><sub id='yjMFw'></sub></form><legend id='yjMFw'></legend><bdo id='yjMFw'><pre id='yjMFw'><center id='yjMFw'></center></pre></bdo></b><th id='yjMFw'></th></span></q></dt></tr></i><div id='yjMFw'><tfoot id='yjMFw'></tfoot><dl id='yjMFw'><fieldset id='yjMFw'></fieldset></dl></div>

    <small id='yjMFw'></small><noframes id='yjMFw'>

      <bdo id='yjMFw'></bdo><ul id='yjMFw'></ul>
  1. <legend id='yjMFw'><style id='yjMFw'><dir id='yjMFw'><q id='yjMFw'></q></dir></style></legend>

      <tfoot id='yjMFw'></tfoot>
    1. XAMPP 在 Windows 上的 PHP 运行速度太慢了 100 倍

      PHP on Windows with XAMPP running 100 times too slow(XAMPP 在 Windows 上的 PHP 运行速度太慢了 100 倍)
    2. <tfoot id='bIq2E'></tfoot>
    3. <legend id='bIq2E'><style id='bIq2E'><dir id='bIq2E'><q id='bIq2E'></q></dir></style></legend>
        <tbody id='bIq2E'></tbody>

        <small id='bIq2E'></small><noframes id='bIq2E'>

            • <bdo id='bIq2E'></bdo><ul id='bIq2E'></ul>
              <i id='bIq2E'><tr id='bIq2E'><dt id='bIq2E'><q id='bIq2E'><span id='bIq2E'><b id='bIq2E'><form id='bIq2E'><ins id='bIq2E'></ins><ul id='bIq2E'></ul><sub id='bIq2E'></sub></form><legend id='bIq2E'></legend><bdo id='bIq2E'><pre id='bIq2E'><center id='bIq2E'></center></pre></bdo></b><th id='bIq2E'></th></span></q></dt></tr></i><div id='bIq2E'><tfoot id='bIq2E'></tfoot><dl id='bIq2E'><fieldset id='bIq2E'></fieldset></dl></div>
              1. 本文介绍了XAMPP 在 Windows 上的 PHP 运行速度太慢了 100 倍的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                PHP 在我的 Windows 桌面上运行如此缓慢,以至于 phpMyAdmin 需要几分钟才能打开一个数据库.下面是运行一个简单的PHP测试程序的时间对比:

                PHP runs so slowly on my Windows desktop that phpMyAdmin takes minutes to open a database. Here’s a comparison of the time to run a simple PHP test program:

                • 运行 XAMPP 的 Windows 8.1 机器:3597 毫秒
                • iPage 共享主机:65 毫秒
                • A2Hosting 共享主机:26 毫秒

                这是测试程序……

                <?php
                $rStartTime = microtime(true);
                $countTo = 100000;
                $a = 0;
                //$countTo = $countTo * 100;
                for ($x = 0; $x <= $countTo; $x++) {
                    $a = sqrt(pow($x, 2));
                }
                $rMs = floor((microtime(true) - $rStartTime) * 1000);
                echo 'timer done, countTo=' . $a . ' ms=' . $rMs;
                

                测试程序在没有调试的情况下运行,通过输入http://localhost/timer.php"进入火狐.

                The test program is run without debugging, by entering "http://localhost/timer.php" into Firefox.

                本地机器通常非常快.它正在运行……

                The local machine is normally blazing fast. It’s running…

                • Windows 8.1
                • XAMPP 1.8.3(控制面板 v3.2.1)
                • Apache 2.4.4(最新是 2.4.20)
                • PHP 5.5.3
                • 反恶意软件 = Windows Defender
                • IDE = PHPStorm 10.0.2

                是什么让 PHP 运行如此缓慢?

                What's making PHP run so slowly?

                推荐答案

                我发现问题出在xamppphpphp.ini中的Xdebug.以下是尝试在网络上找到的许多解决方案的结果:

                I found the problem was Xdebug in xamppphpphp.ini. Here're the results of trying many solutions found around the web:

                以管理员身份运行 XAMPP 并重启服务器:3617 ms

                Run XAMPP as adminisrator and restart server: 3617 ms

                在 xampp/apache/conf/httpd.conf 中,将 localhost 替换为 127.0.0.1 并重新启动服务器:3639 ms

                In xampp/apache/conf/httpd.conf, replace localhost with 127.0.0.1 and restart server: 3639 ms

                在 Windows/System32/drivers/etc/hosts 中,添加127.0.0.1 127.0.0.1" &127.0.0.1 localhost"并重新启动 Windows:3960 ms

                In Windows/System32/drivers/etc/hosts, add "127.0.0.1 127.0.0.1" & "127.0.0.1 localhost" and restart Windows: 3960 ms

                在 Windows/System32/drivers/etc/hosts 中,取消注释127.0.0.1 localhost"并重新启动 Windows:3659 ms

                In Windows/System32/drivers/etc/hosts, un-comment "127.0.0.1 localhost" and restart Windows: 3659 ms

                在 php.ini 中,取消注释 zend_extension = "C:xamppphpextphp_eaccelerator_ts.dll" 并重启服务器:3643 ms

                In php.ini, uncomment zend_extension = "C:xamppphpextphp_eaccelerator_ts.dll" and restart server: 3643 ms

                在 php.ini 中,设置 xdebug.remote_enable=0:3598 毫秒

                In php.ini, set xdebug.remote_enable=0: 3598 ms

                在 php.ini 中,设置 remote_host="localhost": 3593 ms

                In php.ini, set remote_host="localhost": 3593 ms

                在 php.ini 中,设置 xdebug.profiler_enable=0:249 ms

                In php.ini, set xdebug.profiler_enable=0: 249 ms

                在 php.ini 中,注释掉所有 Xdebug 语句:27 ms - 成功!

                In php.ini, comment out all Xdebug statements: 27 ms - Success!

                可悲的是,我犯了错误,需要 Xdebug :-(

                The sad part is, I make mistakes and need Xdebug :-(

                这篇关于XAMPP 在 Windows 上的 PHP 运行速度太慢了 100 倍的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Converting string to MySQL timestamp format in php(在php中将字符串转换为MySQL时间戳格式)
                datetime to timestamp(日期时间到时间戳)
                PHP timestamp date to user timezone(PHP时间戳日期到用户时区)
                Converting TIMESTAMP to unix time in PHP?(在 PHP 中将 TIMESTAMP 转换为 unix 时间?)
                Convert ISO 8601 to unixtimestamp(将 ISO 8601 转换为 unixtimestamp)
                Finding days between 2 unix timestamps in php(在php中查找2个unix时间戳之间的天数)
                  <bdo id='UjfhW'></bdo><ul id='UjfhW'></ul>

                    <small id='UjfhW'></small><noframes id='UjfhW'>

                      <tbody id='UjfhW'></tbody>

                      • <legend id='UjfhW'><style id='UjfhW'><dir id='UjfhW'><q id='UjfhW'></q></dir></style></legend>
                        <tfoot id='UjfhW'></tfoot>

                        <i id='UjfhW'><tr id='UjfhW'><dt id='UjfhW'><q id='UjfhW'><span id='UjfhW'><b id='UjfhW'><form id='UjfhW'><ins id='UjfhW'></ins><ul id='UjfhW'></ul><sub id='UjfhW'></sub></form><legend id='UjfhW'></legend><bdo id='UjfhW'><pre id='UjfhW'><center id='UjfhW'></center></pre></bdo></b><th id='UjfhW'></th></span></q></dt></tr></i><div id='UjfhW'><tfoot id='UjfhW'></tfoot><dl id='UjfhW'><fieldset id='UjfhW'></fieldset></dl></div>