Hi: I've installed Apache 2.4 webserver with PHP 7.2 on a Windows 10 workstation. Everything works beautifully until I change the documentroot in Apache's http.conf file. When I change it, php files in the new home directory don't get parsed by PHP. Apache stops sending .php files to the php engine, and the .php files load like an ordinary file. I see the .php loaded in the web brower, but only the <html> portions of the page are shown. <?php> sections are treated as ordinary text. Here's what I changed in the http.conf file: OLD SETTING: DocumentRoot "${SRVROOT}/htdocs" <Directory "${SRVROOT}/htdocs"> NEW SETTING: #DocumentRoot "${SRVROOT}/htdocs" DocumentRoot "C:/WWW" #<Directory "${SRVROOT}/htdocs"> <Directory "C:/WWW"> When I do that, Apache goes to the new directory, but stops sending .php files to the PHP engine. Any ideas what I'm doing wrong? Thanks!
Try these: https://www.techrepublic.com/article/how-to-fix-apache-2-not-executing-php-files/ Put a .htaccess file in your new document root with that <filesMatch> code.
Thank you for responding. The problem was a minor one. In the fresh install of PHP, the "short_open_tag" in PHP.ini was set to "Off". The phpinfo file in Apache directory opened with "<?php>" and the file in the new directory opened with "<?>", so it didn't parse. I've changed the php.ini file with "short_open_tag = On" and all is well now. Simple little things can sometimes trip us up.