Getting 404 error when accessing php page in apache in a simple php application? -


i have created simple php file sample.php under /var/www/project/dummy/test/sample.php

here httpd.conf

 listen 8080     <virtualhost *:8080>             servername example.com             documentroot "/var/www/projects/dummy/test"             <directory "/var/www/projects/dummy/test">                 allowoverride                 allow             </directory>     </virtualhost> 

here sample.php (just checking if memcache enabled)

<? php  if(class_exists('memcache')){   echo "found"; }  ?> 

when access localhost:8080/sample.php or localhost:8080/test/sample.php, 404 error. unable figure out going wrong.

i concerned why localhost if failing.

to add that, www.example.com/sample.php failing.

thanks help

p.s: have mapped ip address in /etc/hosts follows:

127.0.0.1 example.com www.example.com localhost

why localhost failing?

the document root in httpd.conf /var/www/projects/dummy/test, said files located @ /var/www/project/dummy/test/sample.php. note "project" singular in 1 , plural in other. cause 404's.

the apache logs place start when debugging 404's. i'm not sure os you're running, on ubuntu can found @ /var/log/apache2/error.log.


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -