Trying to migrate to new server

Hi there,

i don’t see any way to solve this problem:

Created a new Server with a new version of Virtualmin and moved two virtual hosts from the old to the new server. Unfortunately, php won’t work at all. It will always offer me the index.php for download, whatever i do.

One of the problems could be found here:

The original apache .conf file for that virtual host reads for publichtml folder like this:

Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php .php
AddHandler fcgid-script .php
AddHandler fcgid-script .php5.6
AddHandler fcgid-script .php7.0
AddHandler fcgid-script .php7.2
AddHandler fcgid-script .php7.3
FCGIWrapper /home/id2019/fcgi-bin/php7.2.fcgi .php
FCGIWrapper /home/id2019/fcgi-bin/php5.6.fcgi .php5.6
FCGIWrapper /home/id2019/fcgi-bin/php7.0.fcgi .php7.0
FCGIWrapper /home/id2019/fcgi-bin/php7.2.fcgi .php7.2
FCGIWrapper /home/id2019/fcgi-bin/php7.3.fcgi .php7.3

and for the cgi-bin folder:

RemoveHandler .php
RemoveHandler .php5.6
RemoveHandler .php7.0
RemoveHandler .php7.2
RemoveHandler .php7.3
php_admin_value engine Off
FcgidMaxRequestLen 1073741824

The new host has the following entries for publichtml:

Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php .php
AddHandler fcgid-script .php
AddHandler fcgid-script .php7.0
AddHandler fcgid-script .php7.2
AddHandler fcgid-script .php7.3
AddHandler fcgid-script .php7.4
FCGIWrapper /home/innovationday2019/fcgi-bin/php7.4.fcgi .php
FCGIWrapper /home/innovationday2019/fcgi-bin/php7.0.fcgi .php7.0
FCGIWrapper /home/innovationday2019/fcgi-bin/php7.2.fcgi .php7.2
FCGIWrapper /home/innovationday2019/fcgi-bin/php7.3.fcgi .php7.3
FCGIWrapper /home/innovationday2019/fcgi-bin/php7.4.fcgi .php7.4

and for cgi-bin:
RemoveHandler .php
RemoveHandler .php7.0
RemoveHandler .php7.2
RemoveHandler .php7.3
RemoveHandler .php7.4
php_admin_value engine Off
FcgidMaxRequestLen 1073741824

So why wouldnt all virtual hosts not serve any php ? I killed the first installation and setup a new virtual host and put in my filesystem and loaded my database and setup configuration files correctly, but no avail.

Best of all, i told Virtualmin to use PHP 7.3, but in apache server 7.2 is configured and in /home/domain.tld/etc i only find a php7.0 folder.

I would need to have it up and running on Monday. I am pretty sure, that this is something small to tweak, but it keeps me from finishing my work. I surfed around quite a lot, and tried all solutions which might be helping to solve this, but as i said before…

Yes, i also tried to set to a different execution mode, and back again, tried literally every possible configuration.

Update: The older server bears the option: Run CGI scripts as domain owner? which was being set to Yes. The new server doesn’t have that option …

This one makes me crazy.

Any advice please, perhaps someone can push me in the right direction.

Thanks and best
j_m

PS: When i reverted the new settings to the old settings, no avail. both are running on FCGId and the downloaded index.php is according the php version selected.

Which php version are getting detected by virtualmin? I think I know whats the problem, just want to make sure. To go: Virtualmin -> System Settings -> Re-Check Configuration .

Well, looks like:

The following PHP versions are available : 7.0.33 (/usr/bin/php-cgi7.0), 7.2.33 (/usr/bin/php7.2), 7.3.21 (/usr/bin/php7.3), 7.4.9 (/usr/bin/php7.4), 7.0 (mod_php)

The following PHP execution modes are available : mod_php cgi fcgid fpm

The following PHP-FPM versions are available on this system : 7.0.4 (php7.0-fpm)

PHP versions have changed to 7.0, 7.0, 7.2, 7.3, 7.4 since last check. Regenerating any missing php.ini files.

Now it won’t download the php file, but i got an error 500 instead.

Interestingly enough, virtualmin updated the .conf files and i was able to select the other php versions after install.

I will check, what’s going on now, and let you know.

Thank you :.)

Best
j_m

If you have multiple ones installed, its normal (if allowed) to change the php version.
Provide more information about the 500 error (log files).
But you shouldn’t use mod_php unless really (like really, and even then not really^^) needed.

This time it is:
mod_fcgid: error reading data from FastCGI server
End of script output before headers: index.php

Thank you
j_m

Nextthng i tried, besides switching to cgi was switching to fpm, to find out, i forgot to install the various -fpm extensions…
Now i am waiting ages for Re-Check System…

We’ll see.

I do not need to run the website on fcgi, if fpm works… But it keeps nagging, why virtualmin wouldn’t serve them with fcgi anyway.

Best
j_m

If its the default one, then thats the answer.

So installed all the fpm versions, and switched over, and voila, the pages will be served. Am wondering why i couldn’t just restore two virtual servers and get them up and running in no time. On the other hand, it only serves www.domain.tld, but not http://domain.tld Latter one throws session_save_path errors. session.save_path is being /home/user/tmp and the folder has got 777…

But it is working with www, so what to check? I started pulling my hair, but that didn’t help either.

Best
j_m

Either it isn’t properly set in the vhost and net settings or something else is interfering.
Did you check the log files?
What precisely is not happening or whats happening with the domain that doesn’t properly work?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.