Jump to content

PrestaShop on XAMPP and OS X


Recommended Posts

I have been trying for 4 days to get PrestaShop to work. I have had one thing after another after another; XAMPP completely refused to work and after trying everything that the entire internet suggested I erased my drive and installed a fresh copy of OS X.

 

Now, OS X and XAMPP are running nice and I can connect to Apache, MySQL, FTPD and phpMyAdmin.

 

I have downloaded prestashop and moved it to /Applications/XAMPP/xamppfiles/htdocs/prestashop, however, when I open localhost/prestashop it returns localhost/prestashop/install/ and is blank.

 

I have tried looking online and changed /Applications/XAMPP/xamppfiles/htdocs/prestashop/config/defines.inc.php to:

 

if (!defined('_PS_MODE_DEV_'))

define('_PS_MODE_DEV_', true);          <<===== from false
/* Compatibility warning */
define('_PS_DISPLAY_COMPATIBILITY_WARNING_', true);
if (_PS_MODE_DEV_ === true)
 
Now, when I open localhost/prestashop/install I get:
 
Fatal error: Class 'Tools' not found in /Applications/XAMPP/xamppfiles/htdocs/prestashop/classes/PrestaShopAutoload.php on line 163
 
I have had a look at /Applications/XAMPP/xamppfiles/htdocs/prestashop/classes/PrestaShopAutoload.php and have absolutely no idea what I'm looking at. This is what I have - with 163 highlighted below:
 
{
$classes = array_merge(
$this->getClassesFromDir('classes/'),
$this->getClassesFromDir('controllers/'),
$this->getClassesFromDir('Adapter/'),
$this->getClassesFromDir('Core/')
);
 
if ($this->_include_override_path)
$classes = array_merge(
$classes,
$this->getClassesFromDir('override/classes/', defined('_PS_HOST_MODE_')),
$this->getClassesFromDir('override/controllers/', defined('_PS_HOST_MODE_'))
);
 
ksort($classes);
$content = '<?php return '.var_export($classes, true).'; ?>';
 
// Write classes index on disc to cache it
$filename = $this->normalizeDirectory(_PS_ROOT_DIR_).PrestaShopAutoload::INDEX_FILE;
$filename_tmp = tempnam(dirname($filename), basename($filename.'.'));
if ($filename_tmp !== false && file_put_contents($filename_tmp, $content) !== false)
{
if (!@rename($filename_tmp, $filename))
unlink($filename_tmp);
else
@chmod($filename, 0666);
}
// $filename_tmp couldn't be written. $filename should be there anyway (even if outdated), no need to die.
else
Tools::error_log('Cannot write temporary file '.$filename_tmp);          <<===== line 163
$this->index = $classes;
}
 
 
 
RESOLVED: line 163 should have had // at the beginning as it's a comment. Unsure why when I downloaded it, it came like that but atlas it's fixed.
Edited by mclachlan.m (see edit history)
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
×
×
  • Create New...