phpinfo 发送空响应 (MacPorts)
phpinfo sending empty response (MacPorts)
当我将 phpinfo();
添加到 运行 站点的 index.php(甚至是空白页面)时,服务器发送一个空响应。相关信息:
- 如果我删除
phpinfo();
页面将按预期运行。这些站点还遵守 Apache 重定向指令。
- 我将 MacPorts 用于 PHP 和 Apache
- 我最近升级到最新的 macOS 和最新版本的 MacPorts。
- 我已经运行
sudo port upgrade outdated
phpinfo
在命令行上工作(不足为奇)。
php.ini
文件不包含 disable_functions
列表中的 phpinfo
。
事实证明这是 PHP 附魔库的问题。 There is already a bug reported related to this.
用户实际上创建了一个特别有用的脚本,我在下面复制了它:
#!/usr/bin/env bash
# list installed, don't try to deactivate php56-apache2handler|php56-curl because of dependencies
for thePort in $( port echo installed | awk '{if(~'/^php56-/') print ;}' | grep -v -E 'php56-apache2handler|php56-curl' ) ; do
# try do deactivate a module
echo -n "Test without $thePort : "
port deactivate $thePort
if [ ! "$?" -eq "0" ] ; then
echo "Error for deactivate"
exit 1
fi
# began tests
/opt/local/bin/php -i &> /dev/null
if [ ! "$?" -eq "0" ] ; then
echo "ERROR php -i"
else
echo "OK"
echo -n "Web test : "
port unload apache2
sleep 2
port load apache2
sleep 1
# The address of the web server; <?php phpinfo(); in the file
curl http://127.0.0.1/info.php &> ~/tmpCurlOut
# If the curl command exits with an error, then we've
if [ ! "$?" -eq "0" ] ; then
echo "web test past"
else
echo "Faulty module is $thePort"
exit 1
fi
fi
# on reactive
port activate $thePort
if [ ! "$?" -eq "0" ] ; then
echo "Error for activate"
exit 1
fi
done
当我将 phpinfo();
添加到 运行 站点的 index.php(甚至是空白页面)时,服务器发送一个空响应。相关信息:
- 如果我删除
phpinfo();
页面将按预期运行。这些站点还遵守 Apache 重定向指令。 - 我将 MacPorts 用于 PHP 和 Apache
- 我最近升级到最新的 macOS 和最新版本的 MacPorts。
- 我已经运行
sudo port upgrade outdated
phpinfo
在命令行上工作(不足为奇)。php.ini
文件不包含disable_functions
列表中的phpinfo
。
事实证明这是 PHP 附魔库的问题。 There is already a bug reported related to this.
用户实际上创建了一个特别有用的脚本,我在下面复制了它:
#!/usr/bin/env bash
# list installed, don't try to deactivate php56-apache2handler|php56-curl because of dependencies
for thePort in $( port echo installed | awk '{if(~'/^php56-/') print ;}' | grep -v -E 'php56-apache2handler|php56-curl' ) ; do
# try do deactivate a module
echo -n "Test without $thePort : "
port deactivate $thePort
if [ ! "$?" -eq "0" ] ; then
echo "Error for deactivate"
exit 1
fi
# began tests
/opt/local/bin/php -i &> /dev/null
if [ ! "$?" -eq "0" ] ; then
echo "ERROR php -i"
else
echo "OK"
echo -n "Web test : "
port unload apache2
sleep 2
port load apache2
sleep 1
# The address of the web server; <?php phpinfo(); in the file
curl http://127.0.0.1/info.php &> ~/tmpCurlOut
# If the curl command exits with an error, then we've
if [ ! "$?" -eq "0" ] ; then
echo "web test past"
else
echo "Faulty module is $thePort"
exit 1
fi
fi
# on reactive
port activate $thePort
if [ ! "$?" -eq "0" ] ; then
echo "Error for activate"
exit 1
fi
done