System environment: The EasyPHP12 php used comes with 5.4.6. The web directory is E:\EasyPHP12\www in the installation directory. I created a project test
Set php.ini > include_path= "E:\ EasyPHP12\www\test" has set an absolute path, but the relative path has not been set up or understood.
a.php (test file)
inc/auth.php (test file in the inc directory)
The code in a.php is as follows
<?php
include_once("inc/auth.php");
?>
<!DOCTYPE html>
<html>
<head> </head>
</html>
auth.php
<?
phpinfo();
$ddd="1";
?>
There are 2 problems
1. When I open http://127.0.0.1:8887/test/a.php locally, When opening the source code, it feels like the code is read directly, but the code in include_once is not executed. What's going on? If phpinfo() is moved to a.php, it will execute normally.
<?
phpinfo();
$ddd="1";
?>
<!DOCTYPE html>
<html>
<head> </head>
</html>
2. I use the $ddd variable in a.php, the code: echo $ddd; does not work, and an error is reported.
Notice: Undefined variable: ddd in E:\EasyPHP12\www\test\a.php on line 11