Avatar of RationalRabbit
RationalRabbit
 asked on

Migration and permissions

I am migrating several sites from one CentOS to another. The dedicated servers are owned by two different hosting companies. Most php file permissions on Server 1 are set at 644. I successfully manually transferred 5 sites with no problem, transferring the files from Server 1 to my local hard drive, then uploading from there to Server 2. Last night, I went through the same process with 2 other sites, and those sites came up with an Internal Server Error. Finally found that all the PHP files (at least those I looked at) had changed the permissions to 664 (writable by group) which produces an error on this server. However, looking at the files from the first five sites, they are all 644. And looking at the original files of the last 2 sites on Server 1, these are also set at 644. So something changed the permissions on these last 2 sites from 644 to 664. I'm trying to determine what may have cause this, and I have no answers. Tech support was no help.
PHP

Avatar of undefined
Last Comment
RationalRabbit

8/22/2022 - Mon
Dave Baldwin

Changing permissions from 644 to 664 is unlikely to cause an error.  I would look at your 'php.ini' from both sites and make sure that all the extensions you need are enabled on the 'new' server.
RationalRabbit

ASKER
But, it is causing an error. Error log says  SoftException in Application.cpp:267: File "/home/.../public_html/index.php" is writeable by group.
a 500 error is served. Changing to 644 displays the page properly.
I did compare the ini files and the ini file on the new server is a "production" ini file. The previous ini has no such designation.
Other than that the files are quite similar, except for extensions.
Server 1
; Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20100525"
zend_extension="/usr/local/IonCube/ioncube_loader_lin_5.4.so"
extension="eaccelerator.so"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.check_mtime="1"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eaccelerator.debug="0"
eaccelerator.enable="1"
eaccelerator.filter=""
eaccelerator.optimizer="1"
eaccelerator.shm_max="0"
eaccelerator.shm_only="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_size="16"
eaccelerator.shm_ttl="0"
extension="suhosin.so"

Server 2
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
; extension_dir = "ext"

The big puzzle is that, using the same method, I already transferred 5 sites, including databases, and those sites are live on the new server, and no permissions were changed.
These last two are the ones where the permissions were changed. I deleted all the files and went through the whole process again, and the same occurred. The only change (that I am aware of) in the server between the first 5 and the last two was the instigation (in cPanel) of auto SSL.
SOLUTION
Dave Baldwin

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
David Favor

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
RationalRabbit

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
RationalRabbit

ASKER
This is the answer to the 500 error. What is causing the permission change is a mystery, as it only has happened on 3 out of 12 sites. But it is not a major problem, as the permissions can be changed.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy