Jump to content
  • 0
zoveress

Cannot scan "override" directory

Question

Hello,

 

I have upgraded my shop from 1.4 to 1.6.1.1.  When I go to Preferences -> SEO & URLs and want to edit any of the URLs below I get a blank screen and the following error message: Cannot scan "override" directory. My override directory is readable so I am unsure why this is happening. I also have regenerated my .htaccess file to be sure but it didn't solve the issue. Any ideas?

Edited by zoveress

Share this post


Link to post
Share on other sites

24 answers to this question

Recommended Posts

  • 0

Activate debug modus for to get a more preciser error for the blank page. If you upgraded from 1,4 to 1.6. you should deinstall all non native modules and also the theme, cause they will not work with PS 1.6.,

 

How to activate debug modus: https://www.prestashop.com/forums/topic/224525-how-to-turn-on-error-reporting-for-debug-information-blank-page-500-internal-server-error/

Share this post


Link to post
Share on other sites
  • 0

Hello, I activated the debug mode, nothing more show up regarding this error...

I am not using old modules or themes do I still need to remove the old theme even though it is not activated?

Share this post


Link to post
Share on other sites
  • 0

Disable all overrides. Tab "advanced parameters -> performance -> debug mode". Set both configurations to "YES".

 

BTW, why do you want to edit the URL's ? You used any module or hack in the past for rewriting the native URL's ?

Edited by selectshop.at

Share this post


Link to post
Share on other sites
  • 0

Hey many thanks for the answer :)

I tried all that already, no luck! Any idea where is this error coming from?

I was gonna edit the meta description information for the index. I am not using any URL rewriting addon.

Edited by zoveress

Share this post


Link to post
Share on other sites
  • 0

Is there any firewall installed on the server ? The message cannot scan... is not a Prestashop common error message. Mod_security module on server should be on OFF - please ask for both your provider.

 

It seems your problem is a very special. Due to upgraded several shops for my customers (also 1.3. to PS 1.6) I've never seen your error code, so I have no clue. Perhaps the upgrade failed ? 

If I were you I will rollback to PS 1.4. and deinstall before upgrade all what is not native (modules, themes, other addons), deactivate your theme by activating default one, and after this try a new upgrade.

 

BTW for all users I suggest to before to make an upgrade of a live shop to try it before on a cloned shop. The architecture PS 1.4. to PS 1.6. is having about 3-4 years development and several things changed since there.

 

Which php-version are you using on server ? 5.3+ (better 5.4+) for PS 1.6. is an absolutely must have.

Edited by selectshop.at

Share this post


Link to post
Share on other sites
  • 0

I do not have mod security on the server and I will definitely not roll back to 1.4 as I spent a week already to use the page in test and then moved it to prod. This is a minor issue, it can be edited from pypmyadmin all the rest of the shop is working perfectly. I am on PHP 5.4 and the upgrade went fine there were no errors. I think I am going to open a bug report with prestashop as it seems nobody has a clue why this is happening. Many thanks for the help so far.

Share this post


Link to post
Share on other sites
  • 0

A little research delivered that the error message comes from \classes\meta.php in the fragment

        if (!$override_files = Tools::scandir(_PS_CORE_DIR_.DIRECTORY_SEPARATOR . 'override' . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR . 'front' . DIRECTORY_SEPARATOR, 'php', '', true)) {
            die(Tools::displayError('Cannot scan "override" directory'));
        }

So that refers to the function scandir in the file \classes\tools.php. That is function of only 30 lines. So with a little bit of debugging it shouldn't be too difficult to find out what goes wrong.

 

This is a new check that was introduced in PS 1.6.1. So it is quite likely that it is some bug.

Edited by musicmaster

Share this post


Link to post
Share on other sites
  • 0

Hello

I'm facing the same issue.

I saw on another forum that this could have something to do with the meta.php (found in: /httpdocs/classes/meta.php)

The original line has blank spaces (by the DOTS):Line 63 - 65

        if (!$override_files = Tools::scandir(_PS_CORE_DIR_.DIRECTORY_SEPARATOR . 'override' . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR . 'front' . DIRECTORY_SEPARATOR, 'php', '', true)) {
            die(Tools::displayError('Cannot scan "override" directory'));
        }

The advice was (same as you can see in the lines above 59-61) to revove the SPACES:

        if (!$override_files = Tools::scandir(_PS_CORE_DIR_.DIRECTORY_SEPARATOR . 'override' . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR . 'front' . DIRECTORY_SEPARATOR, 'php', '', true)) {
            die(Tools::displayError('Cannot scan "override" directory'));
        }

This should end like:

if (!$override_files = Tools::scandir(_PS_CORE_DIR_.DIRECTORY_SEPARATOR.'override'.DIRECTORY_SEPARATOR.'controllers'.DIRECTORY_SEPARATOR.'front'.DIRECTORY_SEPARATOR,'php','',true)) {
die(Tools::displayError('Cannot scan "override" directory'));
		}

For me it is not yet solved. (I had also the spaces between the DOTS)

The poster was telling it was solved for him and he could update his SEO & URLs again.

 

Please help to sove this issue.

 

Alex

Share this post


Link to post
Share on other sites
  • 0

The only quick and sure method of resolving this issue for myself was to remove the php function from the meta.php file and save it. i.e. remove the function that deals with killing the page and displaying the error message.

 

I removed the function and it then gave me access to the SEO section where you can do what you need to.

 

Once completed, head back over to the meta.php file and undo the changes that you made and save the file once more to your server.

 

This is probably not the best way of resolving the issue indefinitely however it is effective and saved me a lot of time as the issue was still there after a fresh install and with all overrides disabled, must be a bug in prestashop somewhere.

 

I'm still looking at a proper solution and will update my reply if I find a sure and safe method of doing so.

Share this post


Link to post
Share on other sites
  • 0

The only quick and sure method of resolving this issue for myself was to remove the php function from the meta.php file and save it. i.e. remove the function that deals with killing the page and displaying the error message.

 

I removed the function and it then gave me access to the SEO section where you can do what you need to.

 

Once completed, head back over to the meta.php file and undo the changes that you made and save the file once more to your server.

 

This is probably not the best way of resolving the issue indefinitely however it is effective and saved me a lot of time as the issue was still there after a fresh install and with all overrides disabled, must be a bug in prestashop somewhere.

 

I'm still looking at a proper solution and will update my reply if I find a sure and safe method of doing so.

This worked for me ,   nice and easy work around   - Thanks sdots

Share this post


Link to post
Share on other sites
  • 0

Problem is related the fact 1.4 does not quite use the same override structure as 1.5+.

 

in 1.4, override/controllers/AController.php, in 1.5+ override/controllers/front/AController.php

Rebuilding the structure, moving files and regenerating the cache/class_index.php solves the issue, assuming the override is compatable and properly written.

Share this post


Link to post
Share on other sites
  • 0

I found another solution. The directory override/controllers/front was empty. After copying an index.php file with the following content in the directory, the error was gone:

 

<?php
/*
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <contact@prestashop.com>
*  @copyright  2007-2015 PrestaShop SA
*  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/
   
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
 
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
 
header("Location: ../");
exit;
 

Share this post


Link to post
Share on other sites
  • 0

Proof that something went really bad within your tree structure. You should ensure that the entire tree exists under override (and cache) and ensure that index.php are inside all of those directories (not to mention that permissions should be appropriate).

prestashop_1.6.1.4/override
prestashop_1.6.1.4/override/index.php
prestashop_1.6.1.4/override/.htaccess
prestashop_1.6.1.4/override/readme_override.txt
prestashop_1.6.1.4/override/classes
prestashop_1.6.1.4/override/classes/index.php
prestashop_1.6.1.4/override/classes/cache
prestashop_1.6.1.4/override/classes/cache/index.php
prestashop_1.6.1.4/override/classes/order
prestashop_1.6.1.4/override/classes/order/index.php
prestashop_1.6.1.4/override/classes/helper
prestashop_1.6.1.4/override/classes/helper/index.php
prestashop_1.6.1.4/override/classes/tree
prestashop_1.6.1.4/override/classes/tree/index.php
prestashop_1.6.1.4/override/classes/exception
prestashop_1.6.1.4/override/classes/exception/index.php
prestashop_1.6.1.4/override/classes/webservice
prestashop_1.6.1.4/override/classes/webservice/index.php
prestashop_1.6.1.4/override/classes/range
prestashop_1.6.1.4/override/classes/range/index.php
prestashop_1.6.1.4/override/classes/shop
prestashop_1.6.1.4/override/classes/shop/index.php
prestashop_1.6.1.4/override/classes/module
prestashop_1.6.1.4/override/classes/module/index.php
prestashop_1.6.1.4/override/classes/pdf
prestashop_1.6.1.4/override/classes/pdf/index.php
prestashop_1.6.1.4/override/classes/db
prestashop_1.6.1.4/override/classes/db/index.php
prestashop_1.6.1.4/override/classes/log
prestashop_1.6.1.4/override/classes/log/index.php
prestashop_1.6.1.4/override/classes/controller
prestashop_1.6.1.4/override/classes/controller/index.php
prestashop_1.6.1.4/override/classes/stock
prestashop_1.6.1.4/override/classes/stock/index.php
prestashop_1.6.1.4/override/classes/tax
prestashop_1.6.1.4/override/classes/tax/index.php
prestashop_1.6.1.4/override/controllers
prestashop_1.6.1.4/override/controllers/index.php
prestashop_1.6.1.4/override/controllers/front
prestashop_1.6.1.4/override/controllers/front/index.php
prestashop_1.6.1.4/override/controllers/admin
prestashop_1.6.1.4/override/controllers/admin/index.php
prestashop_1.6.1.4/override/controllers/admin/templates
prestashop_1.6.1.4/override/controllers/admin/templates/index.php
prestashop_1.6.1.4/override/modules
prestashop_1.6.1.4/override/modules/index.php
prestashop_1.6.1.4/cache
prestashop_1.6.1.4/cache/index.php
prestashop_1.6.1.4/cache/purifier
prestashop_1.6.1.4/cache/purifier/index.php
prestashop_1.6.1.4/cache/smarty
prestashop_1.6.1.4/cache/smarty/index.php
prestashop_1.6.1.4/cache/smarty/cache
prestashop_1.6.1.4/cache/smarty/cache/index.php
prestashop_1.6.1.4/cache/smarty/compile
prestashop_1.6.1.4/cache/smarty/compile/index.php
prestashop_1.6.1.4/cache/push
prestashop_1.6.1.4/cache/push/index.php
prestashop_1.6.1.4/cache/push/activity
prestashop_1.6.1.4/cache/push/trends
prestashop_1.6.1.4/cache/cachefs
prestashop_1.6.1.4/cache/cachefs/index.php
prestashop_1.6.1.4/cache/tcpdf
prestashop_1.6.1.4/cache/tcpdf/index.php
prestashop_1.6.1.4/cache/sandbox
prestashop_1.6.1.4/cache/sandbox/index.php

Share this post


Link to post
Share on other sites
  • 0

 

I found another solution. The directory override/controllers/front was empty. After copying an index.php file with the following content in the directory, the error was gone:

 

<?php
/*
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <contact@prestashop.com>
*  @copyright  2007-2015 PrestaShop SA
*  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/
   
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
 
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
 
header("Location: ../");
exit;

 

It works for me. Thank you.

Share this post


Link to post
Share on other sites
  • 0

This experience - the fact a "auto upgrade" feature claims to have succeeded, when it hasn't, and has left people to hack around in the dark to fix the broken result - is why I'm extricating this e-commerce site into a reliable SaaS provider. This is insane.

Share this post


Link to post
Share on other sites
  • 0

 

I found another solution. The directory override/controllers/front was empty. After copying an index.php file with the following content in the directory, the error was gone:

 

 

 

This worked perfectly for me !! It's even working with an empty file.

Thank you !

Share this post


Link to post
Share on other sites
  • 0

I am new to prestashop and it is very confusing to me.  I have also encountered this problem.  How do you find the override directory and what index.php file do you place in there???

Thank you!

Share this post


Link to post
Share on other sites
  • 0

You'll need to connect with FTP to your server and look for the directory. Then place the index.php file in the directory /override/controllers/front, seen from the root of your PrestaShop installation.

 

Here's a quick guide on FileZilla, the most popular FTP client out there: https://www.siteground.com/tutorials/filezilla/filezilla_management.htm

Share this post


Link to post
Share on other sites
  • 0

 

I found another solution. The directory override/controllers/front was empty. After copying an index.php file with the following content in the directory, the error was gone:

 

<?php
/*
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <contact@prestashop.com>
*  @copyright  2007-2015 PrestaShop SA
*  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/
   
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
 
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
 
header("Location: ../");
exit;

 

 

My site was going through the same issue after I upgrade my prestashop site from 1.4 to 1.6 but this solution worked 100% for me thanks.

Share this post


Link to post
Share on other sites
  • 0

Thanks for this solution...

 

 

I found another solution. The directory override/controllers/front was empty. After copying an index.php file with the following content in the directory, the error was gone:

 

<?php
/*
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <contact@prestashop.com>
*  @copyright  2007-2015 PrestaShop SA
*  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/
   
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
 
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
 
header("Location: ../");
exit;

 

 

Share this post


Link to post
Share on other sites
  • 0

 

I found another solution. The directory override/controllers/front was empty. After copying an index.php file with the following content in the directory, the error was gone:

 

<?php
/*
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <contact@prestashop.com>
*  @copyright  2007-2015 PrestaShop SA
*  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/
   
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
 
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
 
header("Location: ../");
exit;

 

 

it is works. well done. thanks all

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

×