|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
php include problem
I am using RedHat7.2 Linux, and have installed the RPMs of
apache-1.3.22-6.i386.rpm and php-4.0.6-15.i386.rpm However, when I am trying to run this simple script: <html><head><title>PHP Test</title></head> <body> <?php phpinfo(); ?> </body></html> I got the following error message showing in the Mozilla browser: Warning: Failed opening '/home/toto/public_html/hello.php' for inclusion (include_path='.:/php/includes:/usr/share/php') in Unknown on line 0 What is wrong? Can someone experienced help, please? Thanks in advance. |
|
#2
|
|||
|
|||
|
RE: php include problem
Try checking out the permissions on the '/home/toto/public_html/' dir. Make sure whatever user the webserver is running as has read and execute permissions....
|
|
#3
|
|||
|
|||
|
RE: php include problem
I don't think that is the problem. Because this works:
<html><head><title>PHP Test</title></head> <body> <?php echo "hello world"; ?> </body></html> I suspect it is because php server can't find "phpinfo()". But I don't know how to fix it. What do you think? |
|
#4
|
|||
|
|||
|
RE: php include problem
I think you are right. I got the program:
<html><head><title>PHP Test</title></head> <body> <?php phpinfo(); ?> </body></html> work. However, I still can't get this work: <html><head><title>PHP Test</title></head> <body> <?php echo $_SERVER["HTTP_USER_AGENT"]; ?> </body></html> Do you know why? |
|
#5
|
|||
|
|||
|
RE: php include problem
What version of php are you running?
try : print_r($HTTP_SERVER_VARS); and see what that gives you? |
|
#6
|
|||
|
|||
|
RE: php include problem
Server variables: $_SERVER
Note: Introduced in 4.1.0. In earlier versions, use $HTTP_SERVER_VARS. http://www.php.net/manual/en/reserv...ariables.server |
|
#7
|
|||
|
|||
|
RE: php include problem
Since I installed php-4.0.6-15.i386.rpm, the version of php is 4.0.6-15 .
print_r($HTTP_SERVER_VARS); gives: Array ( [DOCUMENT_ROOT] => /home/toto/public_html [HTTP_ACCEPT] => text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1 [HTTP_ACCEPT_CHARSET] => ISO-8859-1, utf-8;q=0.66, *;q=0.66 [HTTP_ACCEPT_ENCODING] => gzip, deflate, compress;q=0.9 [HTTP_ACCEPT_LANGUAGE] => en-us, en;q=0.50 [HTTP_CACHE_CONTROL] => max-age=0 [HTTP_CONNECTION] => keep-alive [HTTP_HOST] => localhost [HTTP_KEEP_ALIVE] => 300 [HTTP_USER_AGENT] => Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020513 [PATH] => /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin [REMOTE_ADDR] => 127.0.0.1 [REMOTE_PORT] => 1394 [SCRIPT_FILENAME] => /home/toto/public_html/hello.php [SERVER_ADDR] => 127.0.0.1 [SERVER_ADMIN] => root@localhost [SERVER_NAME] => localhost [SERVER_PORT] => 80 [SERVER_SIGNATURE] => Apache/1.3.22 Server at localhost Port 80 [SERVER_SOFTWARE] => Apache/1.3.22 (Unix) (Red-Hat/Linux) PHP/4.0.6 [GATEWAY_INTERFACE] => CGI/1.1 [SERVER_PROTOCOL] => HTTP/1.1 [REQUEST_METHOD] => GET [QUERY_STRING] => [REQUEST_URI] => /hello.php [SCRIPT_NAME] => /hello.php [PATH_TRANSLATED] => /home/toto/public_html/hello.php [PHP_SELF] => /hello.php [argv] => Array ( ) [argc] => 0 ) |
|
#8
|
|||
|
|||
|
RE: php include problem
EvilivE is right. Thank you.
And thanks to all of you, who concerned. |
|
#9
|
|||
|
|||
|
RE: php include problem
By the way, is there a way to find out what I should put for the "include_path" in php.ini?
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Installation > php include problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|