Jump to content

Error : Constant __PS_BASE_URI__ already defined


Recommended Posts

Help required folks.

Am trying to edit products in the BE. I can see the products in the BE, but when I click on edit I get a blank page.

Enabled error logging and am getting the below error message :

 

"Constant __PS_BASE_URI__ already defined in /hermes/bosoraweb165/b331/ipg.pcptunes/prestashop/config/config.inc.php on

line 105"

 

Prestashop Version : 1.5.6.2

Link to comment
Share on other sites

  • 4 weeks later...

Hi. Not sure if you've solved this is not, but I have the exact same problem.

 

I've managed to remove the error message by commenting out the following line in the config/config.inc.php file (line 105):

// define('__PS_BASE_URI__', $context->shop->getBaseURI());

So the error reporting is now clean, and everything seems to be working.

 

I doubt this is good practice though, in fact I'd love to know how to fix it properly.

Link to comment
Share on other sites

Hi Nemo

 

The error msg on the front-end pages is:

 

 

 

Notice: Constant __PS_BASE_URI__ already defined in /var/www/vhosts/1/127061/webspace/httpdocs/config/config.inc.php on line 105 Call Stack: 0.0064 234952 1. {main}() /var/www/vhosts/1/127061/webspace/httpdocs/index.php:0 0.0085 300544 2. require('/var/www/vhosts/1/127061/webspace/httpdocs/config/config.inc.php') /var/www/vhosts/1/127061/webspace/httpdocs/index.php:27 0.1043 2496024 3. define() /var/www/vhosts/1/127061/webspace/httpdocs/config/config.inc.php:105 Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/1/127061/webspace/httpdocs/config/config.inc.php:105) in /var/www/vhosts/1/127061/webspace/httpdocs/classes/controller/FrontController.php on line 756 Call Stack: 0.0064 234952 1. {main}() /var/www/vhosts/1/127061/webspace/httpdocs/index.php:0 0.2647 6038224 2. DispatcherCore->dispatch() /var/www/vhosts/1/127061/webspace/httpdocs/index.php:28 0.3010 6609088 3. ControllerCore->run() /var/www/vhosts/1/127061/webspace/httpdocs/classes/Dispatcher.php:348 0.3834 9960432 4. FrontControllerCore->initHeader() /var/www/vhosts/1/127061/webspace/httpdocs/classes/controller/Controller.php:164 0.3834 9960600 5. header() /var/www/vhosts/1/127061/webspace/httpdocs/classes/controller/FrontController.php:756 

 

On the back-end pages it's:

 

 

 

Notice: Constant __PS_BASE_URI__ already defined in /var/www/vhosts/1/127061/webspace/httpdocs/config/config.inc.php on line 105 Call Stack: 0.0023 245168 1. {main}() /var/www/vhosts/1/127061/webspace/httpdocs/admin8254/index.php:0 0.0107 311240 2. require('/var/www/vhosts/1/127061/webspace/httpdocs/config/config.inc.php') /var/www/vhosts/1/127061/webspace/httpdocs/admin8254/index.php:33 0.1413 2506680 3. define() /var/www/vhosts/1/127061/webspace/httpdocs/config/config.inc.php:105

 

I can't see any references to module names. I have installed about 10 modules, all purchased from the PrestaShop store. I should mention that this site has been transferred from another server, but the same error occurs there too.

 

Guess I'll start deleting the installed modules one by one, and see if I can find the problem that way.

Link to comment
Share on other sites

You can simply try disabling them first, then remove them. If it doesn't help, at this point use the following, silimar to what you did before

 

if(!defined(__PS_BASE_URI__))

    define('__PS_BASE_URI__', $context->shop->getBaseURI());

Link to comment
Share on other sites

×
×
  • Create New...