Jump to content

Error when uploading local MAMP site to live


JohnHalsey
 Share

Recommended Posts

Hello,

I've been user Processwire for the first time and absolutely love it.  I had used MODX before and this is so much better.

But I am getting a little stuck when it comes to uploading my local MAMP site to the live server.  This is what I have done so far.

  • Created new Database on live server, exported database from local, and imported to the new db in live.
  • Changed settings in /site/config.php with new database and user details.  But while I'm on this, my config.php file has 2 areas to edit all the database details, is this normal?
  • FTP'd all files over to the live server via FileZilla.  
  • When I load up the domain (web.johnhalsey.co.uk) I get an error.  500 Internal error.  

I have tried putting debug mode to true in the config file but it doesn't change the error.  Have I missed something blatantly obvious (its very possible).

Any help is appreciated,

Thanks

Link to comment
Share on other sites

Sounds like you have something weird going on with your config file regarding the duplication of DB details, but I think your 500 error might be coming from the modrewrite base setting in the .htaccess file.

Some relevant posts that might help you narrow down exactly what needs changing to what:

http://processwire.com/talk/topic/4434-pw-not-installing-correctly-admin-not-found/

http://processwire.com/talk/topic/4917-the-admin-cannot-be-reached-in-new-installation/

Link to comment
Share on other sites

Hi John,

Welcome to PW and the forums.

500 internal errors like that normally point to an Apache error, i.e. something on your server. In addition to Adrian's suggestions, note that some web hosts don't allow some rules in .htaccess file, e.g. these:

Options -Indexes
Options +FollowSymLinks
Options +SymLinksifOwnerMatch
 
Comment those out one by one and see if your site loads. 

If not, also, check  /site/assets/logs/errors.txt although I doubt you'll see anything there at this stage....

Other:

  • if you have access, check your Apache error log
  • Are the folders in your /site/assets/ writable?
  • You actually have a .htaccess file? If you do, rename it temporarily to htacess.txt. Does the problem vanish? If yes, then Apache is definitely unhappy with some rule in your .htaccess file.
  • Are you installing in a sub-directory?

Version of PW?

Edited by kongondo
  • Like 2
Link to comment
Share on other sites

Hello again.

OK, here's an update.  I changed my .htaccess files name to htacces.txt and now the page loads (albeit without loading the stylesheet, which I can look at).  But when I try to access the admin area, i get a 404 error.

I'll be honest and say I'm not really sure what I need to change now.  How do I tell if the files in /site/assets/ are writable?

Thanks for your help.

Link to comment
Share on other sites

It seems the problem is a directive in your .htaccess file. Have you tried to comment out these rules/directives one line at a time, saving and reloading the site as suggested above? That will help you figure out which line is the problem. Do that and let us know how it goes...I'd suggest to first try the ones I mentioned above...

Edit: The bit about renaming .htaccess to htaccess.txt was to find out if that was the problem. You need to rename it back to .htaccess - then, proceed as I suggest above..

Edited by kongondo
Link to comment
Share on other sites

The exercise about commenting out the lines is to find out which rule is causing problems. By now you should be able to tell. Are you saying that you need to comment out every rule in the PW .htaccess in order for the site to work? That would be crazy. Could you find out exactly which rules in the .htaccess are causing problems and post those here? It's a pain but you will have to test commenting out each line until you find the offending line(s)...Or, talk to your host and tell them about your 500 errors...They'll normally tell you which lines to look at.

Some hosts allow you to edit .htaccess files within their file managers in control panel. That should save you the uploading!

Edited by kongondo
Link to comment
Share on other sites

OK, i think I have something.
 
I started by commenting all lines in the .htaccess file (that werent already commented).  tested the site and it loaded up.  Then one by one, uncommented the lines and tested the site.
 
When I uncommented this line...
 

SetEnv HTTP_MOD_REWRITE On

 
I got the error again.  I commented it back, and checked the rest, uncommenting and refreshing.  All is fine.  Its just this one line.  I also tried it as 'Off' but got the error again.

So now the site loads.  I can access the login page, but I cant login.  It doesn't accept the password I set up when I did the local install.

Link to comment
Share on other sites

Success it seems! Good! I'm glad you didn't give up...here's the same issue reported elsewhere:
 
http://processwire.com/talk/topic/1962-cant-reach-admin-page/?p=49524
http://processwire.com/talk/topic/4807-fixes-for-pw-installation-on-a-shared-server/
http://processwire.com/talk/topic/2439-htaccess-issue/?p=49862
 

Here are two more for the record. I Installed pw on a free hoster and suffered from 500 Internal Server Error.
After going through the .htaccess of pw I found that after commenting the following two lines everything works fine.

  # DirectoryIndex index.php index.html index.htm
  # SetEnv HTTP_MOD_REWRITE On
 
I guess every hoster has it settings that you have to adapt to in .htaccess.
Is going through the .htaccess file the only way to solve these issues or what about
some script, other than phpinfo, that can check these hosting settings/restrictions ?

That's a good question and I'm not positive about the answer yet. This is the second time I've see SetEnv not liked by a webhost, so I think we need to at least have a note about it mentioned in the .htaccess file as a possible thing to comment out when a 500 error occurs. The SetEnv here really is only to pass along a message to the installer, and not crucial at all. I've not seen an issue with DirectoryIndex before though, so will keep an eye out to see if that one shows up at any other hosts, in which case we should document that issue too.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...