icietla

Error 500 and htaccess

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! 

Share this post


Link to post
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

Share this post


Link to post
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)...

Share this post


Link to post
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

Share this post


Link to post
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/). 

Share this post


Link to post
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)

Share this post


Link to post
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. 

Share this post


Link to post
Share on other sites

Could you try setup a new ProcessWire installation in your root folder and tell us if it's working?

Share this post


Link to post
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" 

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Jennifer Stock
      Greetings. I would like to restrict access to certain sections of my organization's ProcessWire site using pubcookie. We are rolling out Shibboleth authentication later this year but for now, it seems I can only make use of our institution's single sign-on routine by utilizing rules in an .htaccess file. 
      I am wondering if there is a way to ask PW to apply these rules to certain pages in the site, whether via template type or location in the page tree:
      AuthType UWNetID PubcookieAppID "MyApplication" require type staff faculty  
    • By phillipschmitz
      500 Error after the latest Core Update.
      I have no idea why and what causes the problem, or how to solve it. (Maybe reupload the wire folder?)

       

      Any ideas? 
    • By dweeda
      I installed an SSL Certificate, then edited my .htaccess file:
        # -----------------------------------------------------------------------------------------------
        # 9. If you only want to allow HTTPS, uncomment the RewriteCond and RewriteRule lines below.
        # -----------------------------------------------------------------------------------------------
        RewriteCond %{HTTPS} off
        RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
      by uncommenting out the Rewrite lines.
      Now I get 404 error pages when I try go to any .../processwire-master/<pagename>/
      This includes my admin page at .../processwire-master/processwire/, so i can't get into my admin.
      What else do I need to do?
    • By pwfans
      Hello,
      1. Anybody can help, why this htaccess (location in root) doesn't work at 3.0.98 ? it show 404
      RewriteEngine on RewriteRule ^(.*)$ /subdirectory/$1 [L] That rule works in 3.0.62
      It redirect root request to subdirectory processwire installation and hiding the subdirectory name in url.
      I have try to uncomment htaccess inside subdirectory processwire installation :
      RewriteBase /pw/ to RewriteBase /subdirectory/ Doesn't help, still 404 when open the site from root domain.
      2. Is there anyway to find processwire version from processwire files ? not from admin login page.
      Thank you.
    • By rareyush
      I moved my site to Google cloud platform and i am stuck some where.
      my homepage is working fine but when it comes to other pages it says 404 not found
      and when i add this on virtual host 
       
      <Directory "/var/www"> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> or <Directory "/var/www"> AllowOverride All </Directory>  
          I receive internal server error 
       
       
       
      I tried comment out this line to but still same thing 
      # RewriteBase /
      and
        # RewriteRule ^(.*)$ /index.php?it=$1 [L,QSA]