if i have a file in the root called test.php and this code inside
<?
phpinfo();
?>
will this test if its running and installed okit will tell you whether PHP is being correctly parsed or not.
if it isn't, then the problem could be in your webserver (have you told it to parse .php files through the PHP software), or in something else in the setup (is php.ini in the right place, correct access rights, etc).yes; if PHP is running like it should, viewing that page should bring up something like the attached image shows.what i get is file not found.....I am assuming you are writing:
<!-- m --><a class="postlink" href="http://domain/test.php">http://domain/test.php</a><!-- m -->
in internet explorer.
is this your own server? or a host?http://localhost/intranet/phpinfo.php
and its my own server.I don't think you should have "intranet" in there... just <!-- m --><a class="postlink" href="http://localhost/phpinfo.phptest">http://localhost/phpinfo.phptest</a><!-- m --> procedure:
if you put a html file in the same location, and attempt to open that do you get a 404 error (page not found) again?
YES
check that your webserver is set to redirect incoming http to the correct folder.
NO
If you're using windows and IIS:
check the security settings for the php.ini file, the program files for PHP and the webfolder are such that the IUSR account can read, write and execute them.
check that the php.ini file is in the correct location.
(WINNT for all windows upto an including XP - the program folder for W2K3).
btw, what OS are you using?
if your using Apache, though, I can't help.all works now thanks a lot for all your helpwhat was problem?
just for future reference.well it only seems to work from the root <!-- m --><a class="postlink" href="http://localhost/phpinfo.php">http://localhost/phpinfo.php</a><!-- m --> does not work in a subfolder dunno why?????? any idealshmm.... interesting.
it should treat sub-folders within your webdirectory normally...
so if
c:\inetpub\wwwroot and your file is in a sub-folder \intranet, then the url should work with:
<!-- m --><a class="postlink" href="http://localhost/intranet/file.php">http://localhost/intranet/file.php</a><!-- m -->
does it not find any file in the sub-directory?http://localhost/intranet/
picks up the index.html fine and all the html code works fine. but i did put the phpinfo.php into that folder that i get file can't be found (error 404)hmmm.... are you using IIS? or Apache?iis 5.1this could have somethign to do with user_dir setting in the pHp configuration file.
or possibly doc_root..
doc_root string
PHP's "root directory" on the server. Only used if non-empty. If PHP is configured with safe mode, no files outside this directory are served. If PHP was not compiled with FORCE_REDIRECT, you should set doc_root if you are running PHP as a CGI under any web server (other than IIS). The alternative is to use the cgi.force_redirect configuration below.
user_dir string
The base name of the directory used on a user's home directory for PHP files, for example public_html .do you mean php.iniyeah! thats what I meant by the configuration file!; The root of the PHP pages, used only if nonempty.
; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root
; if you are running php as a CGI under any web server (other than IIS)
; see documentation for security issues. The alternate is to use the
; cgi.force_redirect configuration below
doc_root =
hoe should this read? what format should this be? should this be a sub folder in the root
<?
phpinfo();
?>
will this test if its running and installed okit will tell you whether PHP is being correctly parsed or not.
if it isn't, then the problem could be in your webserver (have you told it to parse .php files through the PHP software), or in something else in the setup (is php.ini in the right place, correct access rights, etc).yes; if PHP is running like it should, viewing that page should bring up something like the attached image shows.what i get is file not found.....I am assuming you are writing:
<!-- m --><a class="postlink" href="http://domain/test.php">http://domain/test.php</a><!-- m -->
in internet explorer.
is this your own server? or a host?http://localhost/intranet/phpinfo.php
and its my own server.I don't think you should have "intranet" in there... just <!-- m --><a class="postlink" href="http://localhost/phpinfo.phptest">http://localhost/phpinfo.phptest</a><!-- m --> procedure:
if you put a html file in the same location, and attempt to open that do you get a 404 error (page not found) again?
YES
check that your webserver is set to redirect incoming http to the correct folder.
NO
If you're using windows and IIS:
check the security settings for the php.ini file, the program files for PHP and the webfolder are such that the IUSR account can read, write and execute them.
check that the php.ini file is in the correct location.
(WINNT for all windows upto an including XP - the program folder for W2K3).
btw, what OS are you using?
if your using Apache, though, I can't help.all works now thanks a lot for all your helpwhat was problem?
just for future reference.well it only seems to work from the root <!-- m --><a class="postlink" href="http://localhost/phpinfo.php">http://localhost/phpinfo.php</a><!-- m --> does not work in a subfolder dunno why?????? any idealshmm.... interesting.
it should treat sub-folders within your webdirectory normally...
so if
c:\inetpub\wwwroot and your file is in a sub-folder \intranet, then the url should work with:
<!-- m --><a class="postlink" href="http://localhost/intranet/file.php">http://localhost/intranet/file.php</a><!-- m -->
does it not find any file in the sub-directory?http://localhost/intranet/
picks up the index.html fine and all the html code works fine. but i did put the phpinfo.php into that folder that i get file can't be found (error 404)hmmm.... are you using IIS? or Apache?iis 5.1this could have somethign to do with user_dir setting in the pHp configuration file.
or possibly doc_root..
doc_root string
PHP's "root directory" on the server. Only used if non-empty. If PHP is configured with safe mode, no files outside this directory are served. If PHP was not compiled with FORCE_REDIRECT, you should set doc_root if you are running PHP as a CGI under any web server (other than IIS). The alternative is to use the cgi.force_redirect configuration below.
user_dir string
The base name of the directory used on a user's home directory for PHP files, for example public_html .do you mean php.iniyeah! thats what I meant by the configuration file!; The root of the PHP pages, used only if nonempty.
; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root
; if you are running php as a CGI under any web server (other than IIS)
; see documentation for security issues. The alternate is to use the
; cgi.force_redirect configuration below
doc_root =
hoe should this read? what format should this be? should this be a sub folder in the root