Jump to content

Error 500 and htaccess


icietla
 Share

Recommended Posts

Hello,

I work on a PW version of this site :

http://www.moulindelapipe.com

The PW works at this URL:

http://www.moulindelapipe.com/v2/

When I move the files at the root, I've an error 500. When I try to change each 500 notes or rewrite base in the htaccess, nothing works more. Remember that it works in /v2/ !

After, I rename .htaccess in htaccess.txt and the error still remains...

No PW logs in the assets about this error.

But in the server logs :

PHP Fatal error:  require(): Failed opening required '/srv/data/web/vhosts/www.moulindelapipe.com/htdocs/v2/wire/core/autoload.php' (include_path='.:/usr/share/php:/srv/data/web/includes') in /srv/data/web/vhosts/www.moulindelapipe.com/htdocs/v2/wire/core/ProcessWire.php on line 18
 
Like it still load the v2 when I load the root index... and at this time, there's nothing in this /v2/ directory as I've moved them at the root.
 
Does anyone understand something?  ???

Thanks for your help! 

Link to comment
Share on other sites

ProcessWire won't work without a .htaccess, so renaming it back to .txt won't solve anything. What rewrite base do you use on the subfolder? Normally it should be like this:

# Subfolder
RewriteBase /v2/

# Root
RewriteBase /
# or even no RewriteBase
Link to comment
Share on other sites

Thank for your answer.

I've renamed the .htaccess just to see if the error still occurs (a Ryan's advise  in https://processwire.com/talk/topic/2439-htaccess-issue/?p=38495 )

In the subfolder, it works with the RewriteBase commented. I've tried RewriteBase / but unfortunately it's not the solution.

I'm very surprised that the site works in the subfolder if it's a question of htaccess configuration (except the rewrite base)...

Link to comment
Share on other sites

I've tried the tips at https://processwire.com/docs/tutorials/troubleshooting-guide/ but it not works...

In fact, even without htaccess I have the 500 error.

When all is ok in /v2/, I move :

- index.php

- .htaccess

- /site/

- /wire/

at the root  folder.

I can comment lines in the htaccess, I see a blank page and a 500 error with the web inspector (see attached file).

When I comment all lines that can make a problem, it's the same. When I rename in htaccess.txt, always the same blank page...

Like it was not a problem in the htaccess but elsewhere.

When I move again theses files in /v2/ (and of course rename htaccess.txt in .htaccess) all works fine in this directory (so it's like the parameters are ok for this server, I should just have to change the RewriteBase if there's any problem don't you think?)

Are there any parameter to change in the database?

post-1990-0-17637100-1430238551_thumb.gi

Link to comment
Share on other sites

Looks like this is really a configuration issue with the server as the .htaccess is only needed for subpages, but the homepage should work without it. You don't need to change anything in the database as the whole cms uses relative urls.

For further debugging, please have a look at the apache logs or maybe the processwire logs(site/assets/logs/). 

Link to comment
Share on other sites

Hello,

in the server log, I see that when I load the root index.php, the server still search the required PHP scripts in the /v2/ !!!

PHP Warning:  require(/srv/data/web/vhosts/www.moulindelapipe.com/htdocs/v2/wire/core/autoload.php): failed to open stream: No such file or directory in /srv/data/web/vhosts/www.moulindelapipe.com/htdocs/v2/wire/core/ProcessWire.php on line 18

PHP Fatal error:  require(): Failed opening required '/srv/data/web/vhosts/www.moulindelapipe.com/htdocs/v2/wire/core/autoload.php' (include_path='.:/usr/share/php:/srv/data/web/includes') in /srv/data/web/vhosts/www.moulindelapipe.com/htdocs/v2/wire/core/ProcessWire.php on line 18

Could it be a problem related to PHP-FPM? (I don't know how this technology works, I don't admin servers)

Link to comment
Share on other sites

Strange thing is, that this error is thrown at a path, that shouldn't be available (…/v2/wire/core/ProcessWire.php). A quick look at the index.php shows, that this file is included by those two lines:

$rootPath = dirname(__FILE__);
…
require("$rootPath/$coreDir/ProcessWire.php"); //$coreDir is just the wire/core part

I don't see, where this could lead to the above path without dirname() having hickups. 

Link to comment
Share on other sites

With every files at the same time at the root and in /v2/ directory, it works!  :)

And after this, even without the /v2/ it continues to work.

I think it was a problem of PHP-FPM cache.

We have added in the htaccess on the first line:

Header add Cache-Control "max-age=1" 

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...