我明白我需要修改一些php.ini文件(从这个问题)。
似乎display_errors设置正确:
echo ini_get '的display_errors');输出 1 。
我还尝试在导致错误的函数中设置display_errors和error_reporting(我知道特定的功能是问题,因为我手动修改它)。
function sendEmail($ aForm,$ sFile ='messages.tpl',$ sTargetEmail = null){ error_reporting(E_ALL); ini_set('display_errors','On'); //其余的功能编辑:我知道我应该将这些值设置为一些php.ini文件 - 当我只能通过FTP访问我的应用程序文件夹时,如何在共享主机上指定php.ini值?
如何识别错误详细信息?
解决方案看起来像我这样打开'display_errors',但您的托管服务提供商正在重定向您的500错误页面到不显示错误的自定义页面。不是一个很好的设置,但我会联系您的托管服务提供商,希望他们能够解释这个问题。有可能在IIS上的.user.ini文件见 见learn.iis/page.aspx/745/enable-per-site-php-configuration-on- iis-60-and-iis-7-and-above / 再次只有您的托管服务提供商才知道是否设置了这个。
I have a PHP application deployed on my IIS hosting and I am always getting generic IIS "error 500" pages insteady of detailed error pages.
I understand I need to modify some php.ini file (from this question).
It seems that display_errors is set correctly:
echo ini_get('display_errors');outputs 1.
I have also tried setting display_errors and error_reporting in the function that causes the error (I know the particular function is the problem because I manually modified it).
function sendEmail( $aForm, $sFile = 'messages.tpl', $sTargetEmail = null ){ error_reporting(E_ALL); ini_set('display_errors', 'On'); //rest of the functionEDIT: I know I should have set these values in some php.ini file - how can I specify php.ini values on a shared hosting, when I have only access to my app folder via FTP?
How can I identify the error details?
解决方案It looks to me like you do have 'display_errors' turned on but your hosting provider is redirecting your 500 error page to a custom page which doesn't display the errors. Not a great set up but I would contact your hosting provider in the hope that they can shed some light on the problem. It is possible to have .user.ini files on IIS see see learn.iis/page.aspx/745/enable-per-site-php-configuration-on-iis-60-and-iis-7-and-above/ again only your hosting provider would know if this is set up.
更多推荐
如何配置PHP显示详细的错误而不是错误500页?
发布评论