简体   繁体   English

php.ini文件不起作用?

[英]php.ini file not working?

I'm taking a php course. 我正在上一门PHP课程。 I made a php.ini file to show errors. 我做了一个php.ini文件来显示错误。

I have the code below on my php.index file. 我的php.index文件中有以下代码。 But instead of the error being displayed just nothing shows up. 但是没有显示错误,而是什么也没有显示。 What am I doing wrong? 我究竟做错了什么?

index.php code: index.php代码:

 <?php

$test="I"m a variable!";

echo $test;

?>

This my php.ini code: 这是我的php.ini代码:

 display_errors = on
 display_startup_errors = on

You should check your error reporting directives 您应该检查错误报告指令

error_reporting = E_ALL
display_errors = ON

But please note that PARSER errors are not being show in display errors, but in error_log. 但是请注意,PARSER错误不是在显示错误中显示,而是在error_log中显示。

您的文件名应为index.php以便服务器可以将其识别为PHP文件。

What is 'php.index'? 什么是“ php.index”? Normally the index page is index.php 通常索引页面是index.php

Where is your php.ini file located? 您的php.ini文件在哪里? Where is it supposed to be located? 应该在哪里?

Do you have access to php interpider (command line)? 您可以访问php interpider(命令行)吗?

phpinfo() can help you location the php.ini file(s) phpinfo()可以帮助您定位php.ini文件

Make sure you are loading the php.ini file that you've created. 确保正在加载已创建的php.ini文件。

call phpinfo() and check the route of the php.ini to see if you are loading yours. 调用phpinfo()并检查php.ini的路由,以查看是否正在加载您的路由。

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

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