Posts

Showing posts with the label php

Apache2 configuration for embedded PHP in HTML files

If you want to use PHP scripts on your web server it is a simple thing to add a script inside a page and save it as a .php file extension. Listing of phpinside.php     <?php        echo "Hello PHP World!"     ?> When this file is browsed if looks like this: Hello PHP World! With the default installation of Apache2 and PHP, however, Apache2 does not know to render an html file as a PHP script. If you name the above file phpinside.html, you will instead see elements of the PHP code when you view the file in a browser. There are thousands of (old) posts for Apache configuration of PHP by editing the httpd.conf file to include HTML as an application/x-http-php type. However, few make note that Apache2 has a new config file structure for Debian (Ubuntu). Refer to the page that I found for a better explanation: Control Escape - Configuring Apache2 on Debian, Ubuntu Now the "AddType application/x-http-php" directive is in the php5.conf file in the &qu