Apache2: Public_html PHP Configuration - 5 views
-
Update 2010-11: Configure PHP for User Directories. There have been more than a couple searches leading here that are similar to "configure PHP virtual hosts". There was a change to the default Apache config introduced in Ubuntu 10.4, Lucid Lynx. There is a message in the /etc/apache2/mods-available/php5.conf file that tells you what to do. REMEMBER: Restart apache and clear your browser's cache after the changes are made. A more detailed description is given at the Ubuntu User-Directory-PHP Wiki. Here is my copy with the (totally unprofessional) hack to get my ".file" files processed as PHP. <IfModule mod_php5.c> AddHandler application/x-httpd-php .php .html .htm .file <FilesMatch "\.ph(p3?|tml)$"> SetHandler application/x-httpd-php </FilesMatch> <FilesMatch "\.phps$"> SetHandler application/x-httpd-php-source </FilesMatch> # To re-enable php in user directories comment the following lines # (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it # prevents .htaccess files from disabling it. #<IfModule mod_userdir.c> # <Directory /home/*/public_html> # php_admin_value engine Off # </Directory> #</IfModule> </IfModule>
-
Apache2: Virtual Hosts for Clients in Your Private LAN & PHP Configuration Go to the first page Apache2 public_html & Virtual Directories and read the disclaimer. Thanks. Update 2010-11: Configure PHP for User Directories. There have been more than a couple searches leading here that are similar to "configure PHP virtual hosts". There was a change to the default Apache config introduced in Ubuntu 10.4, Lucid Lynx. There is a message in the /etc/apache2/mods-available/php5.conf file that tells you what to do. REMEMBER: Restart apache and clear your browser's cache after the changes are made. A more detailed description is given at the Ubuntu User-Directory-PHP Wiki. Here is my copy with the (totally unprofessional) hack to get my ".file" files processed as PHP. <IfModule mod_php5.c> AddHandler application/x-httpd-php .php .html .htm .file <FilesMatch "\.ph(p3?|tml)$"> SetHandler application/x-httpd-php </FilesMatch> <FilesMatch "\.phps$"> SetHandler application/x-httpd-php-source </FilesMatch> # To re-enable php in user directories comment the following lines # (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it # prevents .htaccess files from disabling it. #<IfModule mod_userdir.c> # <Directory /home/*/public_html> # php_admin_value engine Off # </Directory> #</IfModule> </IfModule>