migrate PHP 14Lts to 16 Lts from 1 server to another * Urgent*

This is rather urgent, creating a seperate thread..

Looks like something has gone wrong on the apache side.. all of sites are either loading with issue or not loading at all. I have had a look at couple of links from the web, but they have not helped.. i have installed all missing modules from PHP and have started apache couple of times..

https://stackoverflow.com/questions/18422140/apache-is-downloading-php-f...

i see this kind of file.. https://d.pr/i/VI7oIv

I hope by the time you reply to this one, i will try to solve the issue..

Status: 
Active

Comments

Title: migrata ubuntu 14Lts to 16 Lts from 1 server to another * Urgent* » migrate PHP 14Lts to 16 Lts from 1 server to another * Urgent*

ok so here is the issue, everytime i switch between FPM and FGI mode.. this variable gets added..

php_admin_value engine Off

How can i disable this to happen.. ? i can confirm on a seperate fresh install of ubuntu 16.04, this is not happening.. #php_admin_value engine Off

I have found a link here.. https://www.virtualmin.com/node/40518 where you could entirely disable mod_php.. but that crashes apache..refering to some of those values in the config.. file.. i would like to get your concurrence.. ? guidance to solve this further..

The PHP config value you're seeing should be in there... I suspect there might be another problem going on.

What is the output of this command:

find /etc/apache2 -type f | xargs grep -i sethandler

i am getting a bit worried..but here it is below

/etc/apache2/conf-available/localized-error-pages.conf:#                  SetHandler directive in a <Location /> context somewhere. Adding
/etc/apache2/conf-available/localized-error-pages.conf:#                         SetHandler none
/etc/apache2/conf-available/php7.0-fpm.conf:        SetHandler "proxy:unix:/run/php/php7.0-fpm.sock|fcgi://localhost"
/etc/apache2/conf-available/php7.1-fpm.conf:        SetHandler "proxy:unix:/run/php/php7.1-fpm.sock|fcgi://localhost"
/etc/apache2/conf-available/php7.0-cgi.conf:    SetHandler application/x-httpd-php
/etc/apache2/conf-available/php7.0-cgi.conf:    SetHandler application/x-httpd-php-source
/etc/apache2/conf-available/php5.6-cgi.conf:    SetHandler application/x-httpd-php
/etc/apache2/conf-available/php5.6-cgi.conf:    SetHandler application/x-httpd-php-source
/etc/apache2/conf-available/php7.1-cgi.conf:    SetHandler application/x-httpd-php
/etc/apache2/conf-available/php7.1-cgi.conf:    SetHandler application/x-httpd-php-source
/etc/apache2/mods-available/ldap.conf:  SetHandler ldap-status
/etc/apache2/mods-available/php7.1.conf:    #SetHandler application/x-httpd-php
/etc/apache2/mods-available/php7.1.conf:    #SetHandler application/x-httpd-php-source
/etc/apache2/mods-available/php5.6.conf:    #SetHandler application/x-httpd-php
/etc/apache2/mods-available/php5.6.conf:    #SetHandler application/x-httpd-php-source
/etc/apache2/mods-available/status.conf:                SetHandler server-status
/etc/apache2/mods-available/proxy_balancer.conf:        #          SetHandler balancer-manager
/etc/apache2/mods-available/info.conf:          SetHandler server-info
/etc/apache2/mods-available/php7.0.conf:    # SetHandler application/x-httpd-php
/etc/apache2/mods-available/php7.0.conf:    # SetHandler application/x-httpd-php-source
/etc/apache2/sites-available/seo.inconsulting.tech.conf:SetHandler proxy:fcgi://localhost:8011
/etc/apache2/sites-available/wp.inconsulting.tech.conf:SetHandler proxy:fcgi://localhost:8004
/etc/apache2/sites-available/hr.inconsulting.tech.conf:SetHandler proxy:fcgi://localhost:8003
/etc/apache2/sites-available/hr.inconsulting.tech.conf:SetHandler proxy:fcgi://localhost:8003
/etc/apache2/sites-available/inconsulting.tech.conf:SetHandler proxy:fcgi://localhost:8002
/etc/apache2/sites-available/inconsulting.tech.conf:SetHandler proxy:fcgi://localhost:8002
/etc/apache2/sites-available/erp.inconsulting.tech.conf:SetHandler proxy:fcgi://localhost:8010
/etc/apache2/sites-available/send.inconsulting.tech.conf:SetHandler proxy:fcgi://localhost:8012
/etc/apache2/sites-available/send.inconsulting.tech.conf:SetHandler proxy:fcgi://localhost:8012
/etc/apache2/sites-available/marketing.interstellarconsulting.com.conf:SetHandler proxy:fcgi://localhost:8007
/etc/apache2/sites-available/marketing.interstellarconsulting.com.conf:SetHandler proxy:fcgi://localhost:8007
/etc/apache2/sites-available/web.inconsulting.tech.conf:SetHandler proxy:fcgi://localhost:8009
/etc/apache2/sites-available/web.inconsulting.tech.conf:SetHandler proxy:fcgi://localhost:8009

Here is where I'd start... in the directory /etc/apache2/conf-available/, there are three files -- php7.1.conf, php7.0.conf, and php5.6-cgi.conf.

In those three files, comment out the "SetHandler" lines, and then restart Apache.

After that, does PHP begin to work properly again?

ok all sites are running fine now ... but there is one is still in trouble... can you suggest what i could check further.. ? interstellarconsulting.com

That site seems to be working okay for me.

What happens when you try to access it?

the site is working fine because i have set to FPM mode.. if i set it to FGI mode, it will stop loading and it will start downloading files.. when you load it..

Hmm, is that particular site configured to use a different PHP version than the other sites?

Also, if you set it back to FCGID, does it start having the same problems again?

ok i have checked again .. but apparently.. it is still failing..when switching over to FCGID mode..

i hve tried with also different versions of PHP.. cleared cache of browser.. get a new SSL certificate.. but still the download.. happens instead of the load of the website.. any other bright ideas ?

Is there perhaps a .htaccess file in that account that's causing problems? You can try temporarily renaming it if there is to see if that helps.

If that doesn't help, could you run this command again to see what the current values are:

find /etc/apache2 -type f | xargs grep -i sethandler

yes .htaccess was the culprit.. i will take it from here.. closing this thread.. i will create seperate ones for some other support i need.. thanks a bunch..

yeah.. that was the message.. i guess i could have still got it to work? :) .. all those long hrs of transfer and unzipping and converting images.. got to me.. no patience left.. :)

Great, I'm glad you got it working, thanks for letting us know!

Hi sorry to come back to again..

i might have missed some steps with the multiple PHP installation.. but the apache directives for new domains.. are having mutliple values of these... where could i correct this?

AddType application/x-httpd-php .php
AddHandler fcgid-script .php7.2
AddHandler fcgid-script .php7.2
AddHandler fcgid-script .php7.2
AddHandler fcgid-script .php
AddHandler fcgid-script .php5.6
AddHandler fcgid-script .php7.0
AddHandler fcgid-script .php7.1
AddHandler fcgid-script .php7.2
FCGIWrapper /home/intertech/domains/ads.inconsulting.tech/fcgi-bin/php7.2.fcgi .php7.2
FCGIWrapper /home/intertech/domains/ads.inconsulting.tech/fcgi-bin/php7.2.fcgi .php7.2
FCGIWrapper /home/intertech/domains/ads.inconsulting.tech/fcgi-bin/php7.2.fcgi .php7.2
FCGIWrapper /home/intertech/domains/ads.inconsulting.tech/fcgi-bin/php7.2.fcgi .php7.2
FCGIWrapper /home/intertech/domains/ads.inconsulting.tech/fcgi-bin/php7.2.fcgi .php7.2
FCGIWrapper /home/intertech/domains/ads.inconsulting.tech/fcgi-bin/php7.2.fcgi .php7.2
FCGIWrapper /home/intertech/domains/ads.inconsulting.tech/fcgi-bin/php5.6.fcgi .php
FCGIWrapper /home/intertech/domains/ads.inconsulting.tech/fcgi-bin/php5.6.fcgi .php5.6
FCGIWrapper /home/intertech/domains/ads.inconsulting.tech/fcgi-bin/php7.0.fcgi .php7.0
FCGIWrapper /home/intertech/domains/ads.inconsulting.tech/fcgi-bin/php7.1.fcgi .php7.1
FCGIWrapper /home/intertech/domains/ads.inconsulting.tech/fcgi-bin/php7.2.fcgi .php7.2
</Directory>
<Directory /home/intertech/domains/ads.inconsulting.tech/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
</Directory>
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.ads.inconsulting.tech
RewriteRule ^(.*) https://ads.inconsulting.tech:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.ads.inconsulting.tech
RewriteRule ^(.*) https://ads.inconsulting.tech:10000/ [R]
RemoveHandler .php7.2
RemoveHandler .php7.2
RemoveHandler .php7.2
RemoveHandler .php
RemoveHandler .php5.6
RemoveHandler .php7.0
RemoveHandler .php7.1
RemoveHandler .php7.2

What you're seeing there I believe is normal... are you experiencing a problem of some kind though?

well i dont like unnecessary duplicate lines being added to the file.. it will or may result to issues later.. what do u think ?

Out of curiosity, what output do you see if you go into System Settings -> Re-Check Config?

The status of your system is being checked to ensure that all enabled features are available, that the mail server is properly configured, and that quotas are active ..

    Your system has 7.80 GB of memory, which is at or above the Virtualmin recommended minimum of 256 MB.

    BIND DNS server is installed, and the system is configured to use it.

    TLSA DNS records will be added to new domains.

    Mail server Postfix is installed and configured.

    Postfix can support per-domain outgoing IP addresses, but is not currently configured to do so. This can be setup in the Postfix Mailserver module.

    Apache is installed.

    The following PHP versions are available : 5.6.32 (/usr/bin/php-cgi5.6), 7.0.26 (/usr/bin/php-cgi7.0), 7.1.12 (/usr/bin/php-cgi7.1), 7.2.0 (/usr/bin/php-cgi)

    PHP-FPM support is available on this system.

    Webalizer is installed.

    Apache is configured to host SSL websites.

    MySQL is installed and running.

    ProFTPD is installed.

    Logrotate is installed.

    SpamAssassin and Procmail are installed and configured for use.

    ClamAV is installed and assumed to be running.

    Plugin AWstats reporting is installed OK.

    Plugin Bootup actions is installed OK.

    Plugin Git repositories is installed OK.

    Plugin Protected web directories is installed OK.

    Plugin SQLite Databases is installed OK.

    Plugin Slave DNS domain is installed OK.

    Using network interface eth0 for virtual IPs.

    Default IPv4 address for virtual servers is 144.76.8.249.

    Default IP address is set to 144.76.8.249, which matches the detected external address.

    Both user and group quotas are enabled for home and email directories.

    All commands needed to create and restore backups are installed.

    The selected package management and update systems are installed OK.
    Chroot jails are available on this system
.. your system is ready for use by Virtualmin.

sorry to bother you again, yesterday .. there was an update on the php version again and when i updated it.. apparently mod_php got activated again..

i have read some articles on the internet.. but could you help me out to properly disable this on my servers...

Disable PHP | Virtualmin
https://www.cloudmin.com/node/6517
Make sure you've disabled mod_php and use only mod_fcgid (we recommend this, anyway, and will make it the default during install in the not too distant future). You can do that by commenting out everything in /etc/httpd/conf.d/php*.conf on Red Hat based systems or using a2dismod on Debian/Ubuntu. Finally, turn off ..

http://crazed.io/2013/05/virtualmin-and-enabling-apache-mpm-worker/

i am note sure which package of php is installing mod_php again and adding the below entries on all of servers again..

/etc/apache2/sites-enabled/thomjetson.com.conf:php_admin_value engine Off
/etc/apache2/sites-enabled/test.mysite.com.conf:php_value suhosin.session.encrypt Off
/etc/apache2/sites-enabled/unixlandworld.com.conf:php_admin_value engine Off

i appreciate your help.. thanks in advance,

Can you paste in the output of this command:

find /etc/apache2 -type f | xargs grep -i sethandler

here you of both the servers..

root@server2:~# find /etc/apache2 -type f | xargs grep -i sethandler
/etc/apache2/conf-available/localized-error-pages.conf:#                  SetHandler directive in a <Location /> context somewhere. Adding
/etc/apache2/conf-available/localized-error-pages.conf:#                         SetHandler none
/etc/apache2/conf-available/php7.0-fpm.conf:        SetHandler "proxy:unix:/run/php/php7.0-fpm.sock|fcgi://localhost"
/etc/apache2/conf-available/php5.6-fpm.conf:        SetHandler "proxy:unix:/run/php/php5.6-fpm.sock|fcgi://localhost"
/etc/apache2/conf-available/php7.1-fpm.conf:        SetHandler "proxy:unix:/run/php/php7.1-fpm.sock|fcgi://localhost"
/etc/apache2/conf-available/php7.0-cgi.conf:    #SetHandler application/x-httpd-php
/etc/apache2/conf-available/php7.0-cgi.conf:    #SetHandler application/x-httpd-php-source
/etc/apache2/conf-available/php5.6-cgi.conf:    #SetHandler application/x-httpd-php
/etc/apache2/conf-available/php5.6-cgi.conf:    #SetHandler application/x-httpd-php-source
/etc/apache2/conf-available/php7.1-cgi.conf:    #SetHandler application/x-httpd-php
/etc/apache2/conf-available/php7.1-cgi.conf:    #SetHandler application/x-httpd-php-source
/etc/apache2/mods-available/ldap.conf:  SetHandler ldap-status
/etc/apache2/mods-available/php7.1.conf:    #SetHandler application/x-httpd-php
/etc/apache2/mods-available/php7.1.conf:    #SetHandler application/x-httpd-php-source
/etc/apache2/mods-available/php5.6.conf:    #SetHandler application/x-httpd-php
/etc/apache2/mods-available/php5.6.conf:    #SetHandler application/x-httpd-php-source
/etc/apache2/mods-available/status.conf:                SetHandler server-status
/etc/apache2/mods-available/proxy_balancer.conf:        #          SetHandler balancer-manager
/etc/apache2/mods-available/info.conf:          SetHandler server-info
/etc/apache2/mods-available/php7.0.conf:    # SetHandler application/x-httpd-php
/etc/apache2/mods-available/php7.0.conf:    # SetHandler application/x-httpd-php-source

server1

/etc/apache2/conf-available/localized-error-pages.conf:#                  SetHandler directive in a <Location /> context somewhere. Adding
/etc/apache2/conf-available/localized-error-pages.conf:#                         SetHandler none
/etc/apache2/conf-available/php7.0-fpm.conf:        SetHandler "proxy:unix:/run/php/php7.0-fpm.sock|fcgi://localhost"
/etc/apache2/conf-available/php7.2-cgi.conf:    SetHandler application/x-httpd-php
/etc/apache2/conf-available/php7.2-cgi.conf:    SetHandler application/x-httpd-php-source
/etc/apache2/conf-available/php7.1-fpm.conf:        SetHandler "proxy:unix:/run/php/php7.1-fpm.sock|fcgi://localhost"
/etc/apache2/conf-available/php7.0-cgi.conf:    SetHandler application/x-httpd-php
/etc/apache2/conf-available/php7.0-cgi.conf:    SetHandler application/x-httpd-php-source
/etc/apache2/conf-available/php5.6-cgi.conf:    SetHandler application/x-httpd-php
/etc/apache2/conf-available/php5.6-cgi.conf:    SetHandler application/x-httpd-php-source
/etc/apache2/conf-available/php7.1-cgi.conf:    SetHandler application/x-httpd-php
/etc/apache2/conf-available/php7.1-cgi.conf:    SetHandler application/x-httpd-php-source
/etc/apache2/conf-available/php7.2-fpm.conf:        SetHandler "proxy:unix:/run/php/php7.2-fpm.sock|fcgi://localhost"
/etc/apache2/mods-available/ldap.conf:  SetHandler ldap-status
/etc/apache2/mods-available/php7.2.conf:    SetHandler application/x-httpd-php
/etc/apache2/mods-available/php7.2.conf:    SetHandler application/x-httpd-php-source
/etc/apache2/mods-available/php7.1.conf:    SetHandler application/x-httpd-php
/etc/apache2/mods-available/php7.1.conf:    SetHandler application/x-httpd-php-source
/etc/apache2/mods-available/status.conf:                SetHandler server-status
/etc/apache2/mods-available/proxy_balancer.conf:        #          SetHandler balancer-manager
/etc/apache2/mods-available/info.conf:          SetHandler server-info
/etc/apache2/mods-available/php7.0.conf:#    SetHandler application/x-httpd-php
/etc/apache2/mods-available/php7.0.conf:#    SetHandler application/x-httpd-php-source

Okay, it looks like you're seeing the same issue that we corrected in Comment #6 above, except there's an additional PHP version installed now (PHP 7.2).

The same steps as above should correct it, though in this case you'd want to edit the file "php7.2.conf".

Also, it looks like the SetHandler lines in "php7.1.conf" may not be commented out as well, you may want to verify that they are.