forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: astecme on January 29, 2018, 07:09:50 pm

Title: Moving CPG from gallery.myweb to myweb.gallery fails
Post by: astecme on January 29, 2018, 07:09:50 pm
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

Title: Re: Moving CPG from gallery.myweb to myweb.gallery fails
Post by: ron4mac on January 29, 2018, 07:42:09 pm
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 (http://forum.coppermine-gallery.net/index.php/topic,79013.0.html).
Title: Re: Moving CPG from gallery.myweb to myweb.gallery fails
Post by: astecme on January 29, 2018, 08:34:19 pm
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..
Title: Re: Moving CPG from gallery.myweb to myweb.gallery fails
Post by: astecme on January 29, 2018, 09:35:51 pm
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
Title: Re: Moving CPG from gallery.myweb to myweb.gallery fails
Post by: phill104 on January 29, 2018, 09:36:16 pm
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.
Title: Re: Moving CPG from gallery.myweb to myweb.gallery fails
Post by: ron4mac on January 29, 2018, 11:28:44 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.
Title: Re: Moving CPG from gallery.myweb to myweb.gallery fails
Post by: astecme on January 30, 2018, 08:13:46 pm
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
Title: Re: Moving CPG from gallery.myweb to myweb.gallery fails
Post by: astecme on January 30, 2018, 08:18:48 pm
this is here

function cpg_db_connect()
{
    global $CONFIG;

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

    if (!$result) {
        return false;
    }
Title: Re: Moving CPG from gallery.myweb to myweb.gallery fails
Post by: phill104 on January 30, 2018, 08:19:47 pm
Then if you have no custom modifications and your theme and plugins are 1.6 compatible, upgrade to 1.6.
Title: Re: Moving CPG from gallery.myweb to myweb.gallery fails
Post by: ron4mac on January 30, 2018, 10:32:12 pm
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.
Title: Re: Moving CPG from gallery.myweb to myweb.gallery fails
Post by: phill104 on January 30, 2018, 11:06:15 pm
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.
Title: Re: Moving CPG from gallery.myweb to myweb.gallery fails
Post by: Bielsa on April 04, 2018, 11:20:31 am
Thanks for the heads up, Phill. What do you suggest people upgrade to btw? I'm just curious to hear your opinion.
Title: Re: Moving CPG from gallery.myweb to myweb.gallery fails
Post by: phill104 on April 05, 2018, 11:32:45 am
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.