简体   繁体   English

Amazon EC2服务器显示错误

[英]Amazon EC2 Server Display Error

I have configured Amazon EC2 Server and install PHP and MySQL . 我已经配置了Amazon EC2 Server并安装了PHP and MySQL I have uploaded my website on it. 我已经在上面上传了我的网站。 it is in smarty . 它很smarty

Problem is when I update any .tpl file, then the server return white page as output in Firefox and Chrome return 500 Internal Server Error . 问题是,当我更新任何.tpl文件时,服务器在Firefox中输出white page并在Firefox中输出,而Chrome返回500 Internal Server Error I have surfed everywhere on internet but got nothing. 我在互联网上到处冲浪,但一无所获。

When I update any .php file then the code work nicely. 当我更新任何.php文件时,代码可以正常工作。 problem is only with .tpl file. 问题仅在于.tpl文件。

I'm willing to bet that your templates_c directory is not writable by Apache (identified as apache or httpd, and you can check in your httpd.conf file), or it hasn't been configured correctly during Smarty initialization. 我敢打赌,Apache无法写您的templates_c目录(标识为apache或httpd,您可以检入httpd.conf文件),或者在Smarty初始化期间未正确配置该目录。

You can try temporarily setting your templates_c directory to 777 permissions to test this hypothesis. 您可以尝试将您的templates_c目录临时设置为777权限,以测试此假设。

If this ends up being the case, then you'll want to assign group ownership of templates_c to apache, and set the folder permissions to 775. ( They explain this in their documentation. ) 如果最终还是这样,那么您将需要将template_c的组所有权分配给apache,并将文件夹权限设置为775。( 他们在其文档中对此进行了解释。

An HTTP status of 500, with no page content (Chrome is just being nice and rendering a default error message for you) means that PHP encountered a Fatal Error. HTTP状态为500,没有页面内容(Chrome很好,为您呈现了默认错误消息),意味着PHP遇到了致命错误。

You will need to find out where PHP is configured to log to (usually a file called php_errors.log ) and see what the error was. 您将需要找出PHP的配置位置(通常是一个名为php_errors.log的文件),并查看错误所在。

Alternatively, you could temporarily allow PHP to output errors to screen, using the error_reporting setting. 另外,您可以使用error_reporting设置暂时允许PHP将错误输出到屏幕上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM