<p>Solution: I'm still having trouble getting help from my host, but after trying a clean install of Craft at public_html and getting the same error, I went elsewhere and it worked flawlessly. Thanks for all your help. Sorry it was such a wild goose chase.</p>

CC BY-SA 3.0
2017-05-29T02:08:41.133Z
Glad you;re on the air -- and at least know a better hosting provider. 

I think the value here is that we covered a lot of steps others might take for more ordinary Server 500 responses. Take care.
narration_sd
CC BY-SA 3.0
2017-05-29T01:12:10.713Z
2017-05-29T01:12:10.713Z
Howard Theriot
<p>Howard, craft itself doesn't break like that, in my experience.</p>

<ul>
<li>set devMode true in config/general.php</li>
<li>try the url again, then look at the logs for craft and php, in craft/storage/runtime/logs</li>
<li>if you don't see anything, look at the php log on the server..</li>
</ul>

<p>The clue should be there.</p>

CC BY-SA 3.0
2017-05-27T03:33:40.537Z
Hmmm. So one thing I see is this…

2017/05/26 22:28:37 [error] [exception.Craft\HttpException.404] exception 'Craft\HttpException' in /home/wenzelspine/subdomains/craft/app/controllers/TemplatesController.php:72

Does that mean it’s still looking at the subdomain? IF so, where can I fix this?
Howard Theriot
CC BY-SA 3.0
2017-05-27T03:39:59.577Z
Also see some PHP errors like this in debug… /home/wenzelspine/craft/app/etc/web/WebApp.php(687): CApplication­>handleError(2048, "Declaration of Craft\DbCommand::addForeignKey() should be compat...", "/home/wenzelspine/craft/app/etc/db/DbCommand.php", 15)
Howard Theriot
CC BY-SA 3.0
2017-05-27T03:40:58.247Z
And this… Fatal error: Class 'Craft\DbCommand' not found in /home/wenzelspine/craft/app/etc/db/DbConnection.php on line 28
Howard Theriot
CC BY-SA 3.0
2017-05-27T22:10:07.717Z
Well, that is all pretty wierd -- and inconsistent. Some of your errors in subdomain, some apparently in main domain, given you copied in the paths texts. Maybe they are from different moments as you attempted this? I'd do the following, per Matt Stein's advice above: a) change the name of the subdomain folder, get it out of there. b) if this doesn't bring clearer errors, remove the wenzelspine/craft/app folder and replace it with assured code. Sftping the release zip to the server and unzipping there is a good way. And then if these don't lead you well, what Matt further suggests is good....
narration_sd
CC BY-SA 3.0
2017-05-28T20:12:25.597Z
`code`2017/05/28 19:56:38 [error] [php] Declaration of Craft\DbCommand::addForeignKey() should be compatible with CDbCommand::addForeignKey($name, $table, $columns, $refTable, $refColumns, $delete = NULL, $update = NULL) (/home/wenzelspine/craft/app/etc/db/DbCommand.php:15) 

`code`2017/05/28 19:56:38 [trace] [system.CModule] Loading "errorHandler" application component
Howard Theriot
CC BY-SA 3.0
2017-05-28T23:08:10.507Z
This is still looking like mixed code sources, as Craft will be consistent.
narration_sd
CC BY-SA 3.0
2017-05-28T23:11:21.847Z
Except: how about php versions? Are you running a different php[perhaps under php-fpm] on the main site vs. the subsite? It would be a 7.x php that looked at signatures -- though there is something still seeming odd about this. You can use a ck.php containing <?php phpinfo(); , executed from web browser, to find out.
narration_sd
CC BY-SA 3.0
2017-05-28T23:30:31.367Z
Running 5.6.30  No difference between staging and live.  Although, I did make some progress as I tried to do a fresh install of Craft at public_html and got the same internal error. That rules out anything to do with me moving the files, so I'm calling it a hosting issue for now.
Howard Theriot
CC BY-SA 3.0
2017-05-27T03:14:22.483Z
2017-05-27T03:24:47.900Z
2017-05-27T03:24:47.900Z
narration_sd
<p>Howard, I'm posting another possibility here to be sure you'll be notified -- can edit it back into original answer or a comment later.</p>

<p>It kind of dawned on me that when you produced the second installation, quite possibly you simply copied <em>everything</em> over from the original. If so, you would have copied the cache content, as well as the code.</p>

<p>This could account for what your logs say -- parts being missing apparently, as addressed still on the subdomain code tree -- as well as Craft mysteriously just not working. That's because the pre-complied php holds the old paths.</p>

<p>The fix for this would be straightforward
- first, cp or sftp out any logs you think you'd want to keep:
- then, if on Craft 2, cd to craft/storage/runtime, then run rm -rf *
- similarly, if on Craft 3, cd to storage/runtime, then run rm -rf *
- pro tip: do be sure where you are carefully, before doing the rm -rf *</p>

<p>If this diagnosis is correct, and your config is ok, then Craft should just start up properly once this clearing is done.  Let us know...</p>

CC BY-SA 3.0
2017-05-28T20:17:06.423Z
I cleared the cache in Craft settings before making the move. I think the reason for the mixed path messages was because I was looking at old logs. I just started there were no references to the subdomain in the new log file. I posted the two errors I did find in my comment below. Still waiting for feedback from my host about the server logs.
Howard Theriot
CC BY-SA 3.0
2017-05-28T23:04:59.257Z
Ok, fair enough. I'm going to leave this extra solution up, as it may help someone else. Glad you saw so at first, and best fortune getting this sorted.
narration_sd
CC BY-SA 3.0
2017-05-28T20:06:38.123Z
2017-05-28T20:06:38.123Z
narration_sd
<p>I moved a site from staging to live. Prior to moving, I logged in to the Craft admin and cleared the caches. I copied the db to the new one and moved the folders like so… </p>

<p>from…<br>
<code>home/subdomains/craft</code><br>
<code>home/subdomains/staging</code></p>

<p>to…<br>
<code>home/craft</code><br>
<code>home/public_html</code>  </p>

<p>I’m getting this in the server log…<br>
<code>[28-May-2017 20:01:30 UTC] PHP Fatal error:  Class 'Craft\DbCommand' not found in /home/wenzelspine/craft/app/etc/db/DbConnection.php on line 28</code></p>

<p>And this in storage/runtime/logs…<br>
<code>2017/05/28 21:33:05 [error] [php] Declaration of Craft\DbCommand::addForeignKey() should be compatible with CDbCommand::addForeignKey($name, $table, $columns, $refTable, $refColumns, $delete = NULL, $update = NULL) (/home/wenzelspine/craft/app/etc/db/DbCommand.php:15)</code></p>

<p><code>2017/05/28 21:33:05 [trace] [system.CModule] Loading "errorHandler" application component</code></p>

CC BY-SA 3.0
2017-05-27T15:43:14.017Z
I'm confused by your example folder structure to start with. You might consider adding vastly more detail (folder structure, host configuration, actual log lines with full error messages, etc.) to this question, or dropping by #help in the Craft CMS Slack group. To me it feels vaguely like missing files, an insufficient host configuration, or something not actually Craft related—it's just hard to tell.
Matt Stein
CC BY-SA 3.0
2017-05-28T22:12:07.010Z
Would you mind moving your comments into the question itself, Howard? The goal is to have a really solid, fleshed-out question to draw equally solid, fleshed-out answers.
Matt Stein
CC BY-SA 3.0
2017-05-28T23:24:39.677Z
OK, I updated the question to reflect the full details. Thanks.
Howard Theriot
<error><server><migration>
HTTP ERROR 500 after move to live
# HTTP ERROR 500 after move to live

(Asked by: username_0 on 2017-05-27)

I moved a site from staging to live. Prior to moving, I logged in to the Craft admin and cleared the caches. I copied the db to the new one and moved the folders like so…

from…  
`home/subdomains/craft`  
`home/subdomains/staging`

to…  
`home/craft`  
`home/public_html`

I’m getting this in the server log…  
`[28-May-2017 20:01:30 UTC] PHP Fatal error: Class 'Craft\DbCommand' not found in /home/wenzelspine/craft/app/etc/db/DbConnection.php on line 28`

And this in storage/runtime/logs…  
`2017/05/28 21:33:05 [error] [php] Declaration of Craft\DbCommand::addForeignKey() should be compatible with CDbCommand::addForeignKey($name, $table, $columns, $refTable, $refColumns, $delete = NULL, $update = NULL) (/home/wenzelspine/craft/app/etc/db/DbCommand.php:15)`

`2017/05/28 21:33:05 [trace] [system.CModule] Loading "errorHandler" application component`

**Tags:** error, server, migration

> **Comments:**
> **username_1**: I'm confused by your example folder structure to start with. You might consider adding vastly more detail (folder structure, host configuration, actual log lines with full error messages, etc.) to this question, or dropping by #help in the Craft CMS Slack group. To me it feels vaguely like missing files, an insufficient host configuration, or something not actually Craft related—it's just hard to tell.  
> **username_1**: Would you mind moving your comments into the question itself, Howard? The goal is to have a really solid, fleshed-out question to draw equally solid, fleshed-out answers.  
> **username_0**: OK, I updated the question to reflect the full details. Thanks.  

---

## 3 answers

### Answer by username_0 on 2017-05-29. Score: 2

Solution: I'm still having trouble getting help from my host, but after trying a clean install of Craft at public\_html and getting the same error, I went elsewhere and it worked flawlessly. Thanks for all your help. Sorry it was such a wild goose chase.

> **Comments:**
> **username_2**: Glad you;re on the air -- and at least know a better hosting provider.   I think the value here is that we covered a lot of steps others might take for more ordinary Server 500 responses. Take care.  

---

### Answer by username_2 on 2017-05-27. Score: 2

Howard, craft itself doesn't break like that, in my experience.

* set devMode true in config/general.php
* try the url again, then look at the logs for craft and php, in craft/storage/runtime/logs
* if you don't see anything, look at the php log on the server..

The clue should be there.

> **Comments:**
> **username_0**: Hmmm. So one thing I see is this…  2017/05/26 22:28:37 [error] [exception.Craft\HttpException.404] exception 'Craft\HttpException' in /home/wenzelspine/subdomains/craft/app/controllers/TemplatesController.php:72  Does that mean it’s still looking at the subdomain? IF so, where can I fix this?  
> **username_0**: Also see some PHP errors like this in debug… /home/wenzelspine/craft/app/etc/web/WebApp.php(687): CApplication­>handleError(2048, "Declaration of Craft\DbCommand::addForeignKey() should be compat...", "/home/wenzelspine/craft/app/etc/db/DbCommand.php", 15)  
> **username_0**: And this… Fatal error: Class 'Craft\DbCommand' not found in /home/wenzelspine/craft/app/etc/db/DbConnection.php on line 28  
> **username_2**: Well, that is all pretty wierd -- and inconsistent. Some of your errors in subdomain, some apparently in main domain, given you copied in the paths texts. Maybe they are from different moments as you attempted this? I'd do the following, per username_1's advice above: a) change the name of the subdomain folder, get it out of there. b) if this doesn't bring clearer errors, remove the wenzelspine/craft/app folder and replace it with assured code. Sftping the release zip to the server and unzipping there is a good way. And then if these don't lead you well, what Matt further suggests is good....  
> **username_0**: `code`2017/05/28 19:56:38 [error] [php] Declaration of Craft\DbCommand::addForeignKey() should be compatible with CDbCommand::addForeignKey($name, $table, $columns, $refTable, $refColumns, $delete = NULL, $update = NULL) (/home/wenzelspine/craft/app/etc/db/DbCommand.php:15)   `code`2017/05/28 19:56:38 [trace] [system.CModule] Loading "errorHandler" application component  
> **username_2**: This is still looking like mixed code sources, as Craft will be consistent.  
> **username_2**: Except: how about php versions? Are you running a different php[perhaps under php-fpm] on the main site vs. the subsite? It would be a 7.x php that looked at signatures -- though there is something still seeming odd about this. You can use a ck.php containing <?php phpinfo(); , executed from web browser, to find out.  
> **username_0**: Running 5.6.30  No difference between staging and live.  Although, I did make some progress as I tried to do a fresh install of Craft at public_html and got the same internal error. That rules out anything to do with me moving the files, so I'm calling it a hosting issue for now.  

---

### Answer by username_2 on 2017-05-28. Score: 1

Howard, I'm posting another possibility here to be sure you'll be notified -- can edit it back into original answer or a comment later.

It kind of dawned on me that when you produced the second installation, quite possibly you simply copied *everything* over from the original. If so, you would have copied the cache content, as well as the code.

This could account for what your logs say -- parts being missing apparently, as addressed still on the subdomain code tree -- as well as Craft mysteriously just not working. That's because the pre-complied php holds the old paths.

The fix for this would be straightforward
- first, cp or sftp out any logs you think you'd want to keep:
- then, if on Craft 2, cd to craft/storage/runtime, then run rm -rf \*
- similarly, if on Craft 3, cd to storage/runtime, then run rm -rf \*
- pro tip: do be sure where you are carefully, before doing the rm -rf \*

If this diagnosis is correct, and your config is ok, then Craft should just start up properly once this clearing is done. Let us know...

> **Comments:**
> **username_0**: I cleared the cache in Craft settings before making the move. I think the reason for the mixed path messages was because I was looking at old logs. I just started there were no references to the subdomain in the new log file. I posted the two errors I did find in my comment below. Still waiting for feedback from my host about the server logs.  
> **username_2**: Ok, fair enough. I'm going to leave this extra solution up, as it may help someone else. Glad you saw so at first, and best fortune getting this sorted.  

---

