0

I was having issues with another piece of code so I broke out this very simple part and put it in a new file:

Test file Location/Name

/var/www/html/php/tst/test.php

Test file Content

<?php

if(is_readable('/var/www/html/php/put/json_load.php')){echo('Worked');}
if(is_readable('/var/www/html/php/put/cr_query.php')){echo('Worked2');}
if(is_readable('/var/www/html/php/put/json_crdata_decode.php')){echo('Worked3');}

require '/var/www/html/php/put/json_load.php';

echo('Worked4');

?>

The output I get from this is

WorkedWorked2Worked3

It seems to be stopping execution at require. I am fairly new to PHP, and have searched long and hard for a solution. Any help is appreciated.

If any more information is needed I'd be glad to provide it.

4

1 回答 1

0

有三种可能:

  • json_load.php 通过调用 exit() 或 die() 停止脚本执行
  • json_load.php 触发错误。您的 display_error 设置为 0,因此您不会遇到任何反馈
  • 分段故障

我怀疑选项 2。编辑您的 php.ini 并将 display_errors 设置为 1,然后重新启动服务器。如果你不知道 php.ini 在哪里运行 phpinfo() 函数,它会告诉你。

于 2013-01-24T23:04:17.483 回答