Moving CPG from gallery.myweb to myweb.gallery fails Moving CPG from gallery.myweb to myweb.gallery fails
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Moving CPG from gallery.myweb to myweb.gallery fails

Started by astecme, January 29, 2018, 07:09:50 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

astecme

Hi there,

I want to move my gallery from a sub domain gallery.myweb/  to its base folder myweb/gallery/ This does not involve any move of data just a change in access. I have changed the URL to reflect the "move" but get a failure as follows

"Fatal error: Uncaught Error: Call to undefined function mysql_connect() in myweb/gallery/include/functions.inc.php:183 Stack trace: #0 myweb/gallery/include/init.inc.php(171): cpg_db_connect() #1 myweb/gallery/index.php(26): require('/homepages/45/d...') #2 {main} thrown in myweb/gallery/include/functions.inc.php on line 183"

I could do with some help/advice please.

Thanks

Allan


ron4mac

That is a sure sign that your main domain is running PHP version 7+. CPG 1.5.x is not compatible with PHP 7+. Not sure how it was running in the sub-domain but there may be a .htaccess file there that causes an older version of PHP to be used. You should use whatever method was used to set the PHP version in the new location, or upgrade CPG to version 1.6.x.

astecme

Many thanks . I will check. However the physical location is the same. The target of forum.myweb is myweb/forum/  same location different method of access..

astecme

Hi there again, You are quite correct. The PHP version is set as part of the subdomain. I used a 1and 1 automatic install into the subdomain but they have no upgrade path yet.

I tried setting php version in the .htaccess file - disaster! so backed out.

Thanks again

phill104

create a phpinfo file, open a plain text file, add the following lines, and save:
Filename: phpinfo.php


<?php

// Show all information, defaults to INFO_ALL
phpinfo();

?>

Upload it to your server in each directory you want to check, in your case both the old and new locations where Coppermine resides. Browse to it and you will see what version of PHP is called in each of the locations.


******* Edit - seems you posted your reply while I was typing.
It is a mistake to think you can solve any major problems just with potatoes.

ron4mac

Quote from: astecme on January 29, 2018, 09:35:51 PM
I used a 1and 1 automatic install into the subdomain but they have no upgrade path yet.
You would do well to avoid, whenever possible, hosting site auto-installers. There are many times that they don't do the job correctly.

astecme

Agreed...

So _ uploaded the latest version of 1.5.46 files and ran upgrade.php. All finished fine. gallery works from its subdomain but does not work if I address it through the site - i.e. no change.

The error I get now through direct - i.e. myweb/gallery/ is

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in myweb/gallery/include/functions.inc.php:183 Stack trace: #0 myweb/gallery/include/init.inc.php(171): cpg_db_connect() #1 myweb/gallery/index.php(26): require('/homepages/45/d...') #2 {main} thrown in /homepages/45/d710415996/htdocs/gallery/include/functions.inc.php on line 183

astecme

this is here

function cpg_db_connect()
{
    global $CONFIG;

    $result = @mysql_connect($CONFIG['dbserver'], $CONFIG['dbuser'], $CONFIG['dbpass']);

    if (!$result) {
        return false;
    }

phill104

Then if you have no custom modifications and your theme and plugins are 1.6 compatible, upgrade to 1.6.
It is a mistake to think you can solve any major problems just with potatoes.

ron4mac

As I had said, CPG 1.5.x is not compatible with PHP 7.  So, although probably good that you did it, your upgrade to 1.5.46 was not going solve the sub/domain issue with PHP 7.

If 1and1 has actually made the cPanel control panel available to you, there may be a section of the panel where you can adjust the PHP configuration. Some cPanels let you adjust it by directory. Failing to get resolution from 1and1, you should probably try upgrading to CPG 1.6.x. It's a pretty simple procedure (see the link I supplied above). If you have a theme or plugins that fail with CPG1.6, we can help to correct the issues.

phill104

I have just reviewed the 1&1 documentation on this and it seems it can be set on a domain basis. In the case of sub-domains, that is considered by the control panel as a separate domain. So using that method should be suitable. Be aware that PHP 5.6 goes end of life on 31st December 2018 so this is probably a good opportunity to upgrade.
It is a mistake to think you can solve any major problems just with potatoes.

Bielsa

Thanks for the heads up, Phill. What do you suggest people upgrade to btw? I'm just curious to hear your opinion.
People think highly of these weight loss pills for women because they're effective.

phill104

CPG 1.6 is very stable and working well. If your plugins are ready and your theme is too then that would be a great way to go. We are lacking in a bit of documentation which is why it is not fully released yet, but that is about it.
It is a mistake to think you can solve any major problems just with potatoes.