fjavi Posted September 5, 2009 Share Posted September 5, 2009 Hi, I've just installed prestashop and when open my shop I get the following message:Notice: Use of undefined constant PHP_URL_HOST - assumed 'PHP_URL_HOST' in /var/www/vhosts/lovers-box.com/httpdocs/classes/Connection.php on line 85Warning: parse_url() expects exactly 1 parameter, 2 given in /var/www/vhosts/lovers-box.com/httpdocs/classes/Connection.php on line 85Any help???Thanks,Javi Link to comment Share on other sites More sharing options...
Patric Posted September 5, 2009 Share Posted September 5, 2009 Please verify the PHP version your server is running. Must be PHP5. Link to comment Share on other sites More sharing options...
fjavi Posted September 5, 2009 Author Share Posted September 5, 2009 yes, the version is 5 I can see the homepage with the message down area and the backoffice works only some parts. Link to comment Share on other sites More sharing options...
codegrunt Posted September 6, 2009 Share Posted September 6, 2009 Sounds like you have a version earlier than 5.1.2 of PHP installed:http://www.php.net/parse_url5.1.2 Added the component parameterSo the problem is that before 5.1.2, this function returned an array of the parsed URL instead of allowing the caller to grab a single value (in this case the host). You can work around this by creating a custom function that does the same thing and changing all references to this function where PHP_URL_HOST is passed.function my_parse_url_host($url) { $a=parse_url($url); if(isset($a['host'])) { return $a['host']; } else { return ''; }}Affected files look like these:./classes/ConnectionsSource.php./classes/Connection.php./modules/pagesnotfound/pagesnotfound.php./modules/statsorigin/statsorigin.php./modules/statslive/statslive.php./admin/tabs/AdminCustomers.php./admin/tabs/AdminOrders.phpSo you would replace things like:parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST))with my_parse_url_host($_SERVER['HTTP_REFERER']) Cheers Link to comment Share on other sites More sharing options...
fjavi Posted September 7, 2009 Author Share Posted September 7, 2009 Thanks codegrun, I don't have any idea of how to do it. I'm not programmer. I'll try to talk my hosting service or find some other with new version of php.Thanks again Link to comment Share on other sites More sharing options...
fjavi Posted September 9, 2009 Author Share Posted September 9, 2009 Solved, PHP version updated on hosting and now working perfect.Thanks,Javi Link to comment Share on other sites More sharing options...
Recommended Posts