Forum

Thread tagged as: Question, Problem, Error

trouble moving local site to dev server for review.

I am trying to move my local set up to my live dev server. Steps followed:

1-ran the compatibility test and got the ok.

2-ran a SQL dump in Navicat on the structure and data

3-created the MySQL db on the dev server

4- created a subdomain of piconline.iswebdev.com

5-imported the sql dump file into the DB using Navicat

6 - uploaded all my files

7- set my config file as instructed here for multiple config settings; File content is below. I don't have live set up yet so that's still empty.

When I visit the page and click on perch to log in, I get all sorts of DB errors. link to perch And some of the tables in the db have an odd name.

Here is a screenshot of the DB tables with their names. [https://piconline.iswebdev.com/db_names.png] (https://piconline.iswebdev.com/db_names.png)


<?php define('PERCH_LICENSE_KEY', 'LICENSE NUMBER HERE'); $http_host = getenv('HTTP_HOST'); switch($http_host) { case('dev.piconline.com:9007') : define("PERCH_DB_USERNAME", 'rootuser'); define("PERCH_DB_PASSWORD", 'rootpassword'); define("PERCH_DB_SERVER", "localhost"); define("PERCH_DB_DATABASE", "pic_ins"); define("PERCH_DB_PREFIX", "perch2_"); break; case('piconline.iswebdev.com') : define("PERCH_DB_USERNAME", 'rckmm_pic'); define("PERCH_DB_PASSWORD", 'serverpassword'); define("PERCH_DB_SERVER", "server.IP"); define("PERCH_DB_DATABASE", "rckmm_piconline"); break; default : define("PERCH_DB_USERNAME", 'mysite_user'); define("PERCH_DB_PASSWORD", 'mysite_password'); define("PERCH_DB_SERVER", "localhost"); define("PERCH_DB_DATABASE", "db-mysite"); break; }
define('PERCH_TZ', 'America/New_York');

define('PERCH_EMAIL_FROM', 'kim@myemail.com');
define('PERCH_EMAIL_FROM_NAME', 'Admin Name');

define('PERCH_LOGINPATH', '/perch');
define('PERCH_PATH', str_replace(DIRECTORY_SEPARATOR.'config', '', __DIR__));
define('PERCH_CORE', PERCH_PATH.DIRECTORY_SEPARATOR.'core');

define('PERCH_RESFILEPATH', PERCH_PATH . DIRECTORY_SEPARATOR . 'resources');
define('PERCH_RESPATH', PERCH_LOGINPATH . '/resources');

define('PERCH_HTML5', true);
Kim Mazzola

Kim Mazzola 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you tested that the value of $http_host is what you're expecting?

I don't know how to do that. Do you have an example here of what I need to do to get that?

And, does that image of the database tables look right to you? I don't see the PERCH_DB_PREFIXtablenamehere tables in my local database, only in the remote DB on the dev server.

Drew McLellan

Drew McLellan 2638 points
Perch Support

No, you should not have any instance of PERCH_DB_PREFIX in your table names.

That's what I thought. Can you tell me how that happened with a SQL dump? Why are they there and can I delete them? Also, how do I check to see the value of $http_host?

Ok, so I deleted the tables and ran the SQL dump file again. Now the tables reinstalled properly. But, when I visit the perch login page I get errors and the PREFIX tables are created in the DB. Hope that helps in some way.

Drew McLellan

Drew McLellan 2638 points
Perch Support

If you're not confident with what you're doing in your config.php file, I'd suggest just stripping it back to a basic single-site version.

Either I'm not explaining this properly or I'm missing something. Whether I set the config.php file up as a single site and use the information I have set up, or I use the multi-server set up, the site still cannot be worked on on my dev server. Please try to help me understand why it's not working in either set up.

My local environment is dev.piconline.com:9007 My development site is on my remote hosting server at hostgator.com and is under the domain "iswebdev.com" where I set a subdomain of piconline.iswebdev.com The live site will be housed at piconline.com

Is there something in those set ups that will not allow the site to function? I mean am I allowed to set iswebdev.com as the development domain? I'm confident my settings are correct. I have the site working perfectly under my local environment. Why won't it work on the dev server?

If this helps, the errors I'm getting are below. There are several more than what I copied here.

The following error occurred:
ALTER TABLE `PERCH_DB_PREFIXcontent_regions` ADD `regionUpdated` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER `regionEditRoles`
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXcontent_regions' doesn't exist
The following error occurred:
ALTER TABLE `PERCH_DB_PREFIXcontent_items` ADD `itemUpdated` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER `itemSearch`
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXcontent_items' doesn't exist
The following error occurred:
ALTER TABLE `PERCH_DB_PREFIXcontent_items` ADD `itemUpdatedBy` CHAR(32) NOT NULL DEFAULT '' AFTER `itemUpdated`
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXcontent_items' doesn't exist
The following error occurred:
ALTER TABLE `PERCH_DB_PREFIXpages` ADD `pageTemplate` CHAR(255) NOT NULL DEFAULT '' AFTER `pageAttributeTemplate`
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXpages' doesn't exist
The following error occurred:
ALTER TABLE `PERCH_DB_PREFIXpages` ADD `templateID` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `pageTemplate`
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXpages' doesn't exist

And, when trying to visit a page that is listed in the parent directory I get the following error

Warning: include(/home/rckmm/piconline/perch/addons/apps/comments/runtime.php): failed to open stream: No such file or directory in /home/rckmm/piconline/perch/core/inc/apps.php on line 21

Warning: include(): Failed opening '/home/rckmm/piconline/perch/addons/apps/comments/runtime.php' for inclusion (include_path='.:/opt/php54/lib/php') in /home/rckmm/piconline/perch/core/inc/apps.php on line 21
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Your configuration file is not defining the PERCH_DB_PREFIX for all configurations. You should move that out of the case statement.

As Drew suggested, you might find it easier to use a single server configuration file if you aren't sure which parts should go where.

Rachel,

Thank you for catching that.I missed that in my config file. However, I followed the directions in the docs here when setting up the config file for multi-servers. https://docs.grabaperch.com/perch/building/servers/multiple-server-config/. I also stated that even with a single server configuration I get the same results. The errors and tables being added to the DB. When I try to login at piconline.iswebdev.com/perch/ I get the errors shown. And, the pages do not show anything but the static HTML code from the footer.

So, changing to a single server doesn't work either. I really need to know how I can get this working so I can allow the client to review the site prior to making it live on their server. Any other ideas as to why this is happening?

Drew McLellan

Drew McLellan 2638 points
Perch Support

It's happening because your configuration file is wrong. Are you sure HTTP_HOST contains the port number on your server? I'd be very surprised, but I guess it's possible.

The config with the port number is on my local mac. So, yes it has a port number in MAMP. It's this listing that's not resolving properly:

case('piconline.iswebdev.com') :
            define("PERCH_DB_USERNAME", 'username');
            define("PERCH_DB_PASSWORD", 'password');
            define("PERCH_DB_SERVER", "IP ADDRESS");
            define("PERCH_DB_DATABASE", "DB_Name");
            break;
Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you checked that $http_host === 'piconline.iswebdev.com' ?

As I mentioned earlier in this thread, I don't know how to do that. I'm not a programmer. I'm a designer and I know HTML and CSS. PHP is not something I know at all. -- I'm sorry.

Even googling it didn't get me an answer that helped. I know its frustrating for you. I do appreciate the help. I only have to get this sorted one time and then I will know how to handle it in the future and won't be a bother. Would I just paste the following onto a page and visit that in a browser?

<?php echo
$http_host
?>
Rachel Andrew

Rachel Andrew 394 points
Perch Support

I think it would be far better if you went back to using the single site configuration file, we really cannot assist with host specific issues in free support.

If you don't understand what that case statement is doing then use the single file with all of the configuration options in it, just as Perch creates when doing the install. That way you won't need to worry what is being returned. If you don't know PHP it would definitely be a good idea to just use what we ship as standard as we can't help with individual server configurations as part of a free support offering.

Rachel,

I did go to a single site configuration file. I mentioned that here in my response to you. However, the single site configuration, STANDARD as shipped, with perch, set up for the remote dev site still throws the same errors for me. I am not sure this is host specific.

Drew McLellan

Drew McLellan 2638 points
Perch Support

If the file works in one environment and not in the other then it's host specific.

What does your config file currently look like, and what error are you getting?

Thank you for not giving up on me.

The root directory shows links to the pages then clicking on the link to perch so that I can log into the admin at piconline.iswebdev.com/perch/ Shows the following errors

~~~The following error occurred: ALTER TABLE PERCH_DB_PREFIXcontent_regions ADD regionUpdated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER regionEditRoles SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXcontent_regions' doesn't exist The following error occurred: ALTER TABLE PERCH_DB_PREFIXcontent_items ADD itemUpdated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER itemSearch SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXcontent_items' doesn't exist The following error occurred: ALTER TABLE PERCH_DB_PREFIXcontent_items ADD itemUpdatedBy CHAR(32) NOT NULL DEFAULT '' AFTER itemUpdated SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXcontent_items' doesn't exist The following error occurred: ALTER TABLE PERCH_DB_PREFIXpages ADD pageTemplate CHAR(255) NOT NULL DEFAULT '' AFTER pageAttributeTemplate SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXpages' doesn't exist The following error occurred: ALTER TABLE PERCH_DB_PREFIXpages ADD templateID INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER pageTemplate SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXpages' doesn't exist The following error occurred: ALTER TABLE PERCH_DB_PREFIXpages ADD pageSubpageTemplates VARCHAR(255) NOT NULL DEFAULT '' AFTER templateID SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXpages' doesn't exist The following error occurred: ALTER TABLE PERCH_DB_PREFIXpages ADD pageCollections VARCHAR(255) NOT NULL DEFAULT '' AFTER pageSubpageTemplates SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXpages' doesn't exist The following error occurred: ALTER TABLE PERCH_DB_PREFIXcategories CHANGE catDisplayPath catDisplayPath CHAR(255) NOT NULL DEFAULT '' SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXcategories' doesn't exist The following error occurred: ALTER TABLE PERCH_DB_PREFIXusers ADD userPasswordToken CHAR(255) NOT NULL DEFAULT 'expired' AFTER userMasterAdmin SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXusers' doesn't exist The following error occurred: ALTER TABLE PERCH_DB_PREFIXusers ADD userPasswordTokenExpires DATETIME NOT NULL DEFAULT '2015-01-01 00:00:00' AFTER userPasswordToken SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXusers' doesn't exist The following error occurred: ALTER TABLE PERCH_DB_PREFIXusers ADD userLastFailedLogin DATETIME NULL AFTER userPasswordTokenExpires SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXusers' doesn't exist The following error occurred: ALTER TABLE PERCH_DB_PREFIXusers ADD userFailedLoginAttempts INT(0) UNSIGNED NOT NULL DEFAULT '0' AFTER userLastFailedLogin SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXusers' doesn't exist The following error occurred: ALTER TABLE PERCH_DB_PREFIXresources ADD INDEX idx_list (resourceParentID, resourceKey, resourceAWOL) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXresources' doesn't exist The following error occurred: ALTER TABLE PERCH_DB_PREFIXcontent_items ADD INDEX idx_regrev USING BTREE (itemID, regionID, itemRev) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXcontent_items' doesn't exist The following error occurred: ALTER TABLE PERCH_DB_PREFIXcontent_items ADD INDEX idx_order USING BTREE (itemOrder) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXcontent_items' doesn't exist The following error occurred: ALTER TABLE PERCH_DB_PREFIXcontent_regions ADD INDEX idx_key USING BTREE (regionKey) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXcontent_regions' doesn't exist The following error occurred: ALTER TABLE PERCH_DB_PREFIXcontent_regions ADD INDEX idx_path USING BTREE (regionPage) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXcontent_regions' doesn't exist The following error occurred: ALTER TABLE PERCH_DB_PREFIXpage_templates ADD templateNavGroups VARCHAR(255) NULL DEFAULT '' AFTER templateReference SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXpage_templates' doesn't exist The following error occurred: ALTER TABLE PERCH_DB_PREFIXuser_privileges ADD UNIQUE INDEX idx_key (privKey) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXuser_privileges' doesn't exist The following error occurred: INSERT INTO PERCH_DB_PREFIXuser_privileges (privKey, privTitle, privOrder) VALUES ('content.navgroups.configure','Configure navigation groups',7), ('content.navgroups.create','Create navigation groups',8), ('content.navgroups.delete','Delete navigation groups',9) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXuser_privileges' doesn't exist The following error occurred: INSERT INTO PERCH_DB_PREFIXuser_privileges (privKey, privTitle, privOrder) VALUES ('content.pages.create.toplevel','Add new top-level pages',3) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXuser_privileges' doesn't exist The following error occurred: INSERT INTO PERCH_DB_PREFIXuser_privileges (privKey, privTitle, privOrder) VALUES ('content.pages.delete.own','Delete pages they created themselves',4) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXuser_privileges' doesn't exist The following error occurred: INSERT INTO PERCH_DB_PREFIXuser_privileges (privKey, privTitle, privOrder) VALUES ('content.templates.configure','Configure master pages',6) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXuser_privileges' doesn't exist The following error occurred: INSERT INTO PERCH_DB_PREFIXuser_privileges (privKey, privTitle, privOrder) VALUES ('content.pages.republish','Republish pages', 12) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXuser_privileges' doesn't exist The following error occurred: ALTER TABLE PERCH_DB_PREFIXpages ADD pageAccessTags VARCHAR(255) NOT NULL DEFAULT '' AFTER pageNavOnly SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXpages' doesn't exist The following error occurred: ALTER TABLE PERCH_DB_PREFIXpages ADD pageCreatorID INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER pageAccessTags SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXpages' doesn't exist The following error occurred: ALTER TABLE PERCH_DB_PREFIXpages ADD pageModified DATETIME NOT NULL DEFAULT '2014-01-01 00:00:00' AFTER pageCreatorID SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXpages' doesn't exist The following error occurred: ALTER TABLE PERCH_DB_PREFIXpages ADD pageAttributes TEXT NOT NULL AFTER pageModified SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXpages' doesn't exist The following error occurred: ALTER TABLE PERCH_DB_PREFIXpages ADD pageAttributeTemplate VARCHAR(255) NOT NULL DEFAULT 'default.html' AFTER pageAttributes SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXpages' doesn't exist The following error occurred: INSERT INTO PERCH_DB_PREFIXuser_privileges (privKey, privTitle, privOrder) VALUES ('content.pages.attributes','Edit page titles and attributes',6) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXuser_privileges' doesn't exist The following error occurred: INSERT INTO PERCH_DB_PREFIXuser_privileges (privKey, privTitle, privOrder) VALUES ('assets.create','Upload assets',1) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXuser_privileges' doesn't exist The following error occurred: INSERT INTO PERCH_DB_PREFIXuser_privileges (privKey, privTitle, privOrder) VALUES ('assets.manage','Manage assets',2) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXuser_privileges' doesn't exist The following error occurred: INSERT INTO PERCH_DB_PREFIXuser_privileges (privKey, privTitle, privOrder) VALUES ('categories.create','Create new categories',1) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXuser_privileges' doesn't exist The following error occurred: INSERT INTO PERCH_DB_PREFIXuser_privileges (privKey, privTitle, privOrder) VALUES ('categories.delete','Delete categories',2) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXuser_privileges' doesn't exist The following error occurred: INSERT INTO PERCH_DB_PREFIXuser_privileges (privKey, privTitle, privOrder) VALUES ('categories.manage','Manage categories',3) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXuser_privileges' doesn't exist The following error occurred: INSERT INTO PERCH_DB_PREFIXuser_privileges (privKey, privTitle, privOrder) VALUES ('categories.sets.create','Create category sets',4) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXuser_privileges' doesn't exist The following error occurred: INSERT INTO PERCH_DB_PREFIXuser_privileges (privKey, privTitle, privOrder) VALUES ('categories.sets.delete','Delete category sets',5) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rckmm_piconline.PERCH_DB_PREFIXuser_privileges' doesn't exist


Here is the current config file: Please note I did also try "localhost" instead of the IP and still get the same errors.

<?php define('PERCH_LICENSE_KEY', 'Licenese Key');

        define("PERCH_DB_USERNAME", 'rckmm_pic');
        define("PERCH_DB_PASSWORD", 'password');
        define("PERCH_DB_SERVER", "IP address of host");
        define("PERCH_DB_DATABASE", "rckmm_piconline"); 

define('PERCH_TZ', 'America/New_York');

define('PERCH_EMAIL_FROM', 'kim@createacardinc.com');
define('PERCH_EMAIL_FROM_NAME', 'Kim Mazzola');

define('PERCH_LOGINPATH', '/perch');
define('PERCH_PATH', str_replace(DIRECTORY_SEPARATOR.'config', '', __DIR__));
define('PERCH_CORE', PERCH_PATH.DIRECTORY_SEPARATOR.'core');

define('PERCH_RESFILEPATH', PERCH_PATH . DIRECTORY_SEPARATOR . 'resources');
define('PERCH_RESPATH', PERCH_LOGINPATH . '/resources');

define('PERCH_HTML5', true);

When trying to view one of the pages listed in the root I get the following errors. Please note: All the perch files are uploaded I have checked that.

Warning: include(/home/rckmm/piconline/perch/addons/apps/comments/runtime.php): failed to open stream: No such file or directory in /home/rckmm/piconline/perch/core/inc/apps.php on line 21

Warning: include(): Failed opening '/home/rckmm/piconline/perch/addons/apps/comments/runtime.php' for inclusion (include_path='.:/opt/php54/lib/php') in /home/rckmm/piconline/perch/core/inc/apps.php on line 21 ~~~

Rachel Andrew

Rachel Andrew 394 points
Perch Support

PERCH_DB_PREFIX is still missing from your file. This needs to be in your config file.

The other error indicates that the comments app runtime is not found.

The comments app runtime is there. I checked. When PERCH_DB_PREFIX is added to the config

  define("PERCH_DB_PREFIX", "perch2_");

I get tables added to the DB like this image: https://iswebdev.com/piconline/db_names.png