1

I have installed Apache 2.4.9 for windows 7 64 and PHP 5.5.10 (also 64 bit), I used articles with step by step detailed manual installation. But I cannot open php files in a browser for some reason. I have checked other threads about similar problems on different websites and I made sure httpd.conf has necessary lines included or uncommented.

Apache starts and stops after I enter httpd -k start/stop. When I enter httpd -t it says 'Syntax OK'. But when I enter localhost/phpinfo.php in address bar in a browser I get 'Not found on this server'. Also when I try in command line 'php phpinfo.php' I get 'could not open input file'.

I don't know what else I could check, all answers I found in forum threads give the same hints and include the same elements of configuration file that must be included in httpd.conf, including root directory, engine = on, display errors = on, load module, AddType and I used .

I will appreciate any help or suggestions. If not - I will go through the installation once again.

linuxbegin
  • 47
  • 1
  • 2
  • 6
  • Check the error log file. – John V. Mar 20 '14 at 00:41
  • 2
    Heavens, you petty autocrats annoy me with your closures. HOW ABOUT ALL THOSE THAT CAME HERE FROM GOOGLE? To me, he describes the problem perfectly and all you've done is kill my chances of getting answers. If you think it's better off in Server Fault, them MOVE IT or provide a link. Also, it IS a programming tool. There is no other reason on earth you would install Apache and PHP on a windows machine. Perhaps the terminology needs change. Stop using "off-topic" as a catch all and avoid the hoity-toity Closed. Consider "Redirected as incorrectly placed" (and be sure to redirect it). – www-0av-Com Dec 13 '17 at 13:28

1 Answers1

2

Troubleshooting: Check that your files are stored in the right directory (generally htdocs for apache)

Look for this line in Apache Config (httpd.conf) files:

# DocumentRoot: The directory out of which you will serve your documents.
DocumentRoot "d:/myproject/apache/htdocs"

Also check file permissions to be sure the apache can access them. Permissions should be set for Apache or everyone on the computer.

Here is an example of an httpd.conf (this is centos, but summary and helps without being too long) taken from here: Apache is downloading php files instead of displaying them

#        
# PHP is an HTML-embedded scripting language which attempts to make it                                             
# easy for developers to write dynamically generated webpages.                                                  
#
<IfModule prefork.c>
  LoadModule php5_module modules/libphp5.so
</IfModule>
<IfModule worker.c>
  LoadModule php5_module modules/libphp5-zts.so
</IfModule>

#
# Cause the PHP interpreter to handle files with a .php extension.
#
AddHandler php5-script .php
AddType text/html .php

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php

#
# Uncomment the following line to allow PHP to pretty-print .phps
# files as PHP source code:
#
#AddType application/x-httpd-php-source .phps
Community
  • 1
  • 1
amanda fouts
  • 347
  • 2
  • 10