Morning all, I am finally moving some old (F9 thru F17) servers to C7 (Plus PHP7/Pgsql10) boxes. On the old boxes they all had it set so that .htm and .html files were handled by PHP in addition to the normal .php files. This was done with the simple change to: AddHandler php5-script .php .htm .html AddType text/html .php .htm .html in /etc/httpd/conf.d/php.inc. I did the same on my first new server but found that this did not work, and the login.html did not get handled. I then added it to fine filematch so my full php.conf on the new box is: <Files ".user.ini"> <IfModule mod_authz_core.c> Require all denied </IfModule> <IfModule !mod_authz_core.c> Order allow,deny Deny from all Satisfy All </IfModule> </Files> AddType text/html .php .htm .html DirectoryIndex index.php <IfModule mod_php7.c> <FilesMatch \.(php|phar|htm|hml)$> SetHandler application/x-httpd-php </FilesMatch> php_value session.save_handler "files" php_value session.save_path "/var/lib/php/session" php_value soap.wsdl_cache_dir "/var/lib/php/wsdlcache" </IfModule> I done some Googling and have found a number of responses saying that this can not be done, this should not be done, this can be done, and here's how to do it. However I haven't found a response that actually works. I have dozens of sites with hundreds of pages so I really would like to find a solution. Can anyone help?
> On Dec 9, 2019, at 3:38 AM, Gary Stainburn <gary.stainburn at ringways.co.uk> wrote: > > Morning all, > > I am finally moving some old (F9 thru F17) servers to C7 (Plus PHP7/Pgsql10) boxes. On the old boxes they all had it set so that .htm and .html files were handled by PHP in addition to the normal .php files. >I do not have an answer to you question, but I?m puzzled: why would you want to do that? Valeri> This was done with the simple change to: > > AddHandler php5-script .php .htm .html > AddType text/html .php .htm .html > > in /etc/httpd/conf.d/php.inc. I did the same on my first new server but found that this did not work, and the login.html did not get handled. I then added it to fine filematch so my full php.conf on the new box is: > > <Files ".user.ini"> > <IfModule mod_authz_core.c> > Require all denied > </IfModule> > <IfModule !mod_authz_core.c> > Order allow,deny > Deny from all > Satisfy All > </IfModule> > </Files> > AddType text/html .php .htm .html > DirectoryIndex index.php > <IfModule mod_php7.c> > <FilesMatch \.(php|phar|htm|hml)$> > SetHandler application/x-httpd-php > </FilesMatch> > php_value session.save_handler "files" > php_value session.save_path "/var/lib/php/session" > php_value soap.wsdl_cache_dir "/var/lib/php/wsdlcache" > </IfModule> > > I done some Googling and have found a number of responses saying that this can not be done, this should not be done, this can be done, and here's how to do it. However I haven't found a response that actually works. I have dozens of sites with hundreds of pages so I really would like to find a solution. Can anyone help? > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos++++++++++++++++++++++++++++++++++++++++ Valeri Galtsev Sr System Administrator Department of Astronomy and Astrophysics Kavli Institute for Cosmological Physics University of Chicago Phone: 773-702-4247 ++++++++++++++++++++++++++++++++++++++++
On Monday 09 December 2019 14:14:42 Valeri Galtsev wrote:> > > On Dec 9, 2019, at 3:38 AM, Gary Stainburn <gary.stainburn at ringways.co.uk> wrote: > > > > Morning all, > > > > I am finally moving some old (F9 thru F17) servers to C7 (Plus PHP7/Pgsql10) boxes. On the old boxes they all had it set so that .htm and .html files were handled by PHP in addition to the normal .php files. > > > > I do not have an answer to you question, but I?m puzzled: why would you want to do that? > > ValeriHi Valeri Purely because of the number of web sites, number of pages, and number of links, not to mention external bookmarks that would need to be changed to rename every page to a .php
Am 09.12.19 um 10:38 schrieb Gary Stainburn:> Morning all, > > I am finally moving some old (F9 thru F17) servers to C7 (Plus PHP7/Pgsql10) boxes. On the old boxes they all had it set so that .htm and .html files were handled by PHP in addition to the normal .php files. > > This was done with the simple change to: > > AddHandler php5-script .php .htm .html > AddType text/html .php .htm .html > > in /etc/httpd/conf.d/php.inc. I did the same on my first new server but found that this did not work, and the login.html did not get handled. I then added it to fine filematch so my full php.conf on the new box is: > > <Files ".user.ini"> > <IfModule mod_authz_core.c> > Require all denied > </IfModule> > <IfModule !mod_authz_core.c> > Order allow,deny > Deny from all > Satisfy All > </IfModule> > </Files> > AddType text/html .php .htm .html > DirectoryIndex index.php > <IfModule mod_php7.c> > <FilesMatch \.(php|phar|htm|hml)$>Typo: ^^^^^? -- Leon
On Monday 09 December 2019 17:50:06 Leon Fauster via CentOS wrote:> Am 09.12.19 um 10:38 schrieb Gary Stainburn: > > <IfModule mod_php7.c> > > <FilesMatch \.(php|phar|htm|hml)$> > > Typo: ^^^^^? > > -- > LeonWell Spotted Leon, and thank you very much. I always look for the complicated answers.