Question

I installed php and apache2 correctly, I am able to open localhost/index.php. Index.php is located in /var/www. However when I open port 8000 by python -m SimpleHTTPServer 8000, localhost:8000/index.php will not be opened, the browser will just to start to download it.

I also add Listen 8000 in ports.conf.

What else do I need to change to make it work properly?

One more question, what do I need to change make php work in all files not just /var/www?

Thanks

Was it helpful?

Solution 2

I just solve my problem. I edited apache2.conf and add 8000 port, then I change the document root to my home directory.

OTHER TIPS

You're using python to respond to the HTTP request, not Apache, so Apache never gets a chance to execute index.php.

Try Google to learn how Apache works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top