Duplicate copy on same server Fatal Error

Duplicate copy on same server Fatal Error

by Alan Cherwinski -
Number of replies: 7

LAMP  Moodle 3.1

I am preparing to upgrade a 3.1 version to the latest stable.  I copied the live php code to a new directory on the same server and setup the subdomain and dns to resolve to the testing address. 

I created a new empty database on the same server and imported the an export from the live database.  I updated the config.php setting with the new wwwroot urll moodledata directory (duplicate copy) and the sql name and user information.


I get the error:  PHP Fatal error: Cannot use 'object' as class name as it is reserved in/home/XXXX/public_html/ecampustest/lib/setuplib.php on line 66

How can there be a code conflict when the platform is common between the live and test environments and the test application code is a direct copy of the live code. 

I have read up on the error, but don't see how the live site does not have the same issue.


Thanks for any insight you might be able to provide.


Alan



Average of ratings: -
In reply to Alan Cherwinski

Re: Duplicate copy on same server Fatal Error

by Ken Task -
Picture of Particularly helpful Moodlers

Sounds like your LAMP box has more than one PHP version installed and the test - even if it's a clone of production - is finding a newer version of PHP.

In setting up a virtual apache ... the clone ... do you have a separate config file for that virtual instance/new domain?

Both virtual servers should be using their own error log files.   Check the logs for the test server.

You didn't say which Linux distro ... so below may not be correct for your server, but think you could pick up some hints from it ... or find one specific to your distro.

https://tecadmin.net/install-multiple-php-version-apache-ubuntu/

SoS, Ken

Average of ratings: Useful (2)
In reply to Ken Task

Re: Duplicate copy on same server Fatal Error

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers
And if you're running two copies of Moodle on the same server, they MUST have unique cookie prefixes - see https://docs.moodle.org/37/en/Session_handling#Cookie_prefix
In reply to Jon Bolton

Re: Duplicate copy on same server Fatal Error

by Alan Cherwinski -
Thanks Jon, When I can get into the Admin panel, I will set a unique cookie prefix.
In reply to Ken Task

Re: Duplicate copy on same server Fatal Error

by Alan Cherwinski -
Thank you Ken ,

The reports I found on the Web pointed to a 7.2 PHP version issue with "object", I suspected this might relate to the issue. Both Moodle install sit on a single server with one cpanel that provides multi-php versions. The default is 7.0.(inherited) The Object issue does not seem to appear in reports until later versions. Both the live and production server are 7.0 (ea). I tried reverting to 5.6 (ea) on the Testing server, but that does not get me past the error.
In reply to Alan Cherwinski

Re: Duplicate copy on same server Fatal Error

by Ken Task -
Picture of Particularly helpful Moodlers

ea is Easy Apache ... allows setting different versions of php to a web site ... and allows one to select php extensions to be used for a site.

It is an app accessed via cPanel.

Do you have ssh interface into your account via cPanel?

IF so, click it ... it's browser based and will log you into your account at /home/customerid/ (or something like that).

Type: env [ENTER]

You are looking for a PATH environment setting.

Have seen this with a user having issues ... more than one cPanel ... the older version in the path variable listed first would be the first PHP seen/used by command line anything as well as web service of a site.

The  second cpanel in the path probably newer is the one you see via web.

You can't fix that ... helpdesk request to inquire about 2 versions and how to keep the  latest - thus only one Easy Apache.

The error might be a 'reserved word' I think ... can't be used in newer PHP but was allowed in older PHP.

Above is guess ... but based upon other 'experience'.

'SoS', Ken


Average of ratings: Useful (1)
In reply to Ken Task

Re: Duplicate copy on same server Fatal Error

by Alan Cherwinski -
I downgraded the PHP version (via cpanel) on a clean sub-domain to 5.5 (alt not EA) and was able to install a clean copy of 3.1.18 (last release). No "Object" conflict. I tried downgrading (5.5 alt) the other testing subdomain that has the clone application code of 3.1.+ and that didn't work. I replaced the the 3.1.+ code on the testing directory with new copy of 3.1.18 pointing at the clone database and that just gives me a blank screen - it should have run an upgrade.
In reply to Alan Cherwinski

Re: Duplicate copy on same server Fatal Error

by Ken Task -
Picture of Particularly helpful Moodlers

Take it no ssh and no env check.

Blank page could be result of ownerships/permissions on config.php ... must be readable by the globe.

Can't read config.php, that moodle won't figure out/trigger upgrade.

Ask again ... got ssh?

You could run code/admin/cli/upgrade.php from CLI.

'SoS', Ken