Jump to content

Blank page for front office and back office


Recommended Posts

This is what I get trying to access my home page or manage page,,,

 

Warning: require_once(/home/content/60/9053760/html/renamedadminfolder/../images.inc.php)

[function.require-once]: failed to open stream: No such file or directory

in /home/content/60/9053760/html/renamedadminfolder/functions.php on line 28

 

Fatal error: require_once() [function.require]: Failed opening required

'/home/content/60/9053760/html/renamedadminfile/../images.inc.php' (include_path='.:/usr/local/php5/lib/php')

in /home/content/60/9053760/html/renamedadminfolder/functions.php on line 28

 

functions.php looks like this,,,, I believe there are at least 28 lines,,, and after functions there is the images.inc.php file,,, I am not good enough to figure this error out but thanks to this forum I was able to fix a couple others. Thanks for any help.

 

<?php

/*

* 2007-2011 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:

* http://opensource.org/licenses/osl-3.0.php

* 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 [email protected] 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 <[email protected]>

* @copyright 2007-2011 PrestaShop SA

* @version Release: $Revision: 10313 $

* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)

* International Registered Trademark & Property of PrestaShop SA

*/

require_once(dirname(__FILE__).'/../images.inc.php');

function bindDatepicker($id, $time)

{

if ($time)

echo '

var dateObj = new Date();

var hours = dateObj.getHours();

var mins = dateObj.getMinutes();

var secs = dateObj.getSeconds();

if (hours < 10) { hours = "0" + hours; }

if (mins < 10) { mins = "0" + mins; }

if (secs < 10) { secs = "0" + secs; }

var time = " "+hours+":"+mins+":"+secs;';

echo '

$(function() {

$("#'.$id.'").datepicker({

prevText:"",

nextText:"",

dateFormat:"yy-mm-dd"'.($time ? '+time' : '').'});

});';

}

// id can be a identifier or an array of identifiers

function includeDatepicker($id, $time = false)

{

global $cookie;

echo '<script type="text/javascript" src="'.__PS_BASE_URI__.'js/jquery/jquery-ui-1.8.10.custom.min.js"></script>';

$iso = Db::getInstance()->getValue('SELECT iso_code FROM '._DB_PREFIX_.'lang WHERE `id_lang` = '.(int)($cookie->id_lang));

if ($iso != 'en')

echo '<script type="text/javascript" src="'.__PS_BASE_URI__.'js/jquery/datepicker/ui/i18n/ui.datepicker-'.$iso.'.js"></script>';

echo '<script type="text/javascript">';

if (is_array($id))

foreach ($id as $id2)

bindDatepicker($id2, $time);

else

bindDatepicker($id, $time);

echo '</script>';

}

/**

* Generate a new settings file, only transmitted parameters are updated

*

* @param string $baseUri Base URI

* @param string $theme Theme name (eg. default)

* @param array $arrayDB Parameters in order to connect to database

*/

function rewriteSettingsFile($baseUrls = NULL, $theme = NULL, $arrayDB = NULL)

{

$defines = array();

$defines['__PS_BASE_URI__'] = ($baseUrls AND $baseUrls['__PS_BASE_URI__']) ? $baseUrls['__PS_BASE_URI__'] : __PS_BASE_URI__;

$defines['_MEDIA_SERVER_1_'] = ($baseUrls AND isset($baseUrls['_MEDIA_SERVER_1_'])) ? $baseUrls['_MEDIA_SERVER_1_'] : _MEDIA_SERVER_1_;

$defines['_MEDIA_SERVER_2_'] = ($baseUrls AND isset($baseUrls['_MEDIA_SERVER_2_'])) ? $baseUrls['_MEDIA_SERVER_2_'] : _MEDIA_SERVER_2_;

$defines['_MEDIA_SERVER_3_'] = ($baseUrls AND isset($baseUrls['_MEDIA_SERVER_3_'])) ? $baseUrls['_MEDIA_SERVER_3_'] : _MEDIA_SERVER_3_;

$defines['_PS_CACHING_SYSTEM_'] = _PS_CACHING_SYSTEM_;

$defines['_PS_CACHE_ENABLED_'] = _PS_CACHE_ENABLED_;

$defines['_THEME_NAME_'] = $theme ? $theme : _THEME_NAME_;

$defines['_DB_NAME_'] = (($arrayDB AND isset($arrayDB['_DB_NAME_'])) ? $arrayDB['_DB_NAME_'] : _DB_NAME_);

$defines['_MYSQL_ENGINE_'] = (($arrayDB AND isset($arrayDB['_MYSQL_ENGINE_'])) ? $arrayDB['_MYSQL_ENGINE_'] : _MYSQL_ENGINE_);

$defines['_DB_SERVER_'] = (($arrayDB AND isset($arrayDB['_DB_SERVER_'])) ? $arrayDB['_DB_SERVER_'] : _DB_SERVER_);

$defines['_DB_USER_'] = (($arrayDB AND isset($arrayDB['_DB_USER_'])) ? $arrayDB['_DB_USER_'] : _DB_USER_);

$defines['_DB_PREFIX_'] = (($arrayDB AND isset($arrayDB['_DB_PREFIX_'])) ? $arrayDB['_DB_PREFIX_'] : _DB_PREFIX_);

$defines['_DB_PASSWD_'] = (($arrayDB AND isset($arrayDB['_DB_PASSWD_'])) ? $arrayDB['_DB_PASSWD_'] : _DB_PASSWD_);

$defines['_DB_TYPE_'] = (($arrayDB AND isset($arrayDB['_DB_TYPE_'])) ? $arrayDB['_DB_TYPE_'] : _DB_TYPE_);

$defines['_COOKIE_KEY_'] = addslashes(_COOKIE_KEY_);

$defines['_COOKIE_IV_'] = addslashes(_COOKIE_IV_);

if (defined('_RIJNDAEL_KEY_'))

$defines['_RIJNDAEL_KEY_'] = addslashes(_RIJNDAEL_KEY_);

if (defined('_RIJNDAEL_IV_'))

$defines['_RIJNDAEL_IV_'] = addslashes(_RIJNDAEL_IV_);

$defines['_PS_VERSION_'] = addslashes(_PS_VERSION_);

$content = "<?php\n\n";

foreach ($defines as $k => $value)

$content .= 'define(\''.$k.'\', \''.addslashes($value).'\');'."\n";

$content .= "\n?>";

if ($fd = @fopen(PS_ADMIN_DIR.'/../config/settings.inc.php', 'w'))

{

fwrite($fd, $content);

fclose($fd);

return true;

}

return false;

}

/**

* Display SQL date in friendly format

*

* @param string $sqlDate Date in SQL format (YYYY-MM-DD HH:mm:ss)

* @param boolean $withTime Display both date and time

* @todo Several formats (french : DD-MM-YYYY)

*/

function displayDate($sqlDate, $withTime = false)

{

return strftime('%Y-%m-%d'.($withTime ? ' %H:%M:%S' : ''), strtotime($sqlDate));

}

/**

* Return path to a product category

*

* @param string $urlBase Start URL

* @param integer $id_category Start category

* @param string $path Current path

* @param string $highlight String to highlight (in XHTML/CSS)

* @param string $type Category type (products/cms)

*/

function getPath($urlBase, $id_category, $path = '', $highlight = '', $categoryType = 'catalog')

{

global $cookie;

 

if ($categoryType == 'catalog')

{

$category = Db::getInstance()->getRow('

SELECT id_category, level_depth, nleft, nright

FROM '._DB_PREFIX_.'category

WHERE id_category = '.(int)$id_category);

if (isset($category['id_category']))

{

$categories = Db::getInstance()->ExecuteS('

SELECT c.id_category, cl.name, cl.link_rewrite

FROM '._DB_PREFIX_.'category c

LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = c.id_category)

WHERE c.nleft <= '.(int)$category['nleft'].' AND c.nright >= '.(int)$category['nright'].' AND cl.id_lang = '.(int)($cookie->id_lang).'

ORDER BY c.level_depth ASC

LIMIT '.(int)($category['level_depth'] + 1));

 

$fullPath = '';

$n = 1;

$nCategories = (int)sizeof($categories);

foreach ($categories AS $category)

{

$edit = '<a href="'.$urlBase.'&id_category='.(int)$category['id_category'].'&'.($category['id_category'] == 1 ? 'viewcategory' : 'addcategory').'&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)).'" title="'.($category['id_category'] == 1 ? 'Home' : 'Modify').'"><img src="../img/admin/'.($category['id_category'] == 1 ? 'home' : 'edit').'.gif" alt="" /></a> ';

$fullPath .= $edit.

($n < $nCategories ? '<a href="'.$urlBase.'&id_category='.(int)$category['id_category'].'&viewcategory&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)).'" title="'.htmlentities($category['name'], ENT_NOQUOTES, 'UTF-8').'">' : '').

(!empty($highlight) ? str_ireplace($highlight, '<span class="highlight">'.htmlentities($highlight, ENT_NOQUOTES, 'UTF-8').'</span>', $category['name']) : $category['name']).

($n < $nCategories ? '</a>' : '').

(($n++ != $nCategories OR !empty($path)) ? ' > ' : '');

}

 

return $fullPath.$path;

}

}

elseif ($categoryType == 'cms')

{

$category = new CMSCategory($id_category, (int)($cookie->id_lang));

if (!$category->id)

return $path;

$name = ($highlight != NULL) ? str_ireplace($highlight, '<span class="highlight">'.$highlight.'</span>', CMSCategory::hideCMSCategoryPosition($category->name)) : CMSCategory::hideCMSCategoryPosition($category->name);

$edit = '<a href="'.$urlBase.'&id_cms_category='.$category->id.'&addcategory&token=' . Tools::getAdminToken('AdminCMSContent'.(int)(Tab::getIdFromClassName('AdminCMSContent')).(int)($cookie->id_employee)).'">

<img src="../img/admin/edit.gif" alt="Modify" /></a> ';

if ($category->id == 1)

$edit = '<a href="'.$urlBase.'&id_cms_category='.$category->id.'&viewcategory&token=' . Tools::getAdminToken('AdminCMSContent'.(int)(Tab::getIdFromClassName('AdminCMSContent')).(int)($cookie->id_employee)).'">

<img src="../img/admin/home.gif" alt="Home" /></a> ';

$path = $edit.'<a href="'.$urlBase.'&id_cms_category='.$category->id.'&viewcategory&token=' . Tools::getAdminToken('AdminCMSContent'.(int)(Tab::getIdFromClassName('AdminCMSContent')).(int)($cookie->id_employee)).'">

'.$name.'</a> > '.$path;

if ($category->id == 1)

return substr($path, 0, strlen($path) - 3);

return getPath($urlBase, $category->id_parent, $path, '', 'cms');

}

}

function getDirContent($path)

{

$content = array();

if (is_dir($path))

{

$d = dir($path);

while (false !== ($entry = $d->read()))

if ($entry{0} != '.')

$content[] = $entry;

$d->close();

}

return $content;

}

function createDir($path, $rights)

{

if (file_exists($path))

return true;

return @mkdir($path, $rights);

}

function checkPSVersion()

{

$upgrader = new Upgrader();

return $upgrader->checkPSVersion();

}

 

images.inc.php

 

<?php

/*

* 2007-2011 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:

* http://opensource.org/licenses/osl-3.0.php

* 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 [email protected] 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 <[email protected]>

* @copyright 2007-2011 PrestaShop SA

* @version Release: $Revision: 7010 $

* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)

* International Registered Trademark & Property of PrestaShop SA

*/

/**

* Generate a cached thumbnail for object lists (eg. carrier, order states...etc)

*

* @param string $image Real image filename

* @param string $cacheImage Cached filename

* @param integer $size Desired size

* @param string $imageType Image type

* @param boolean $disableCache When turned on a timestamp will be added to the image URI to disable the HTTP cache

*/

function cacheImage($image, $cacheImage, $size, $imageType = 'jpg', $disableCache = false)

{

if (file_exists($image))

{

if (!file_exists(_PS_TMP_IMG_DIR_.$cacheImage))

{

$infos = getimagesize($image);

$memory_limit = Tools::getMemoryLimit();

// memory_limit == -1 => unlimited memory

if (function_exists('memory_get_usage') && (int)$memory_limit != -1)

{

$current_memory = memory_get_usage();

 

// Evaluate the memory required to resize the image: if it's too much, you can't resize it.

if (($infos[0] * $infos[1] * $infos['bits'] * (isset($infos['channels']) ? ($infos['channels'] / 8) : 1) + pow(2, 16)) * 1.8 + $current_memory > $memory_limit - 1024 * 1024)

return false;

}

$x = $infos[0];

$y = $infos[1];

$max_x = ((int)$size)*3;

/* Size is already ok */

if ($y < $size && $x <= $max_x )

copy($image, _PS_TMP_IMG_DIR_.$cacheImage);

/* We need to resize */

else

{

$ratioX = $x / ($y / $size);

if($ratioX > $max_x)

{

$ratioX = $max_x;

$size = $y / ($x / $max_x);

}

 

imageResize($image, _PS_TMP_IMG_DIR_.$cacheImage, $ratioX, $size, 'jpg');

}

}

return '<img src="'._PS_TMP_IMG_.$cacheImage.($disableCache ? '?time='.time() : '').'" alt="" class="imgm" />';

}

return '';

}

/**

* Check image upload

*

* @param array $file Upload $_FILE value

* @param integer $maxFileSize Maximum upload size

*/

function checkImage($file, $maxFileSize)

{

if ($file['size'] > $maxFileSize)

return Tools::displayError('Image is too large').' ('.($file['size'] / 1000).Tools::displayError('KB').'). '.Tools::displayError('Maximum allowed:').' '.($maxFileSize / 1000).Tools::displayError('KB');

if (!isPicture($file))

return Tools::displayError('Image format not recognized, allowed formats are: .gif, .jpg, .png');

if ($file['error'])

return Tools::displayError('Error while uploading image; please change your server\'s settings.').'('.Tools::displayError('Error code: ').$file['error'].')';

return false;

}

 

function checkImageUploadError($file)

{

if ($file['error'])

{

switch ($file['error'])

{

case 1:

return Tools::displayError('The file is too large.');

break;

case 2:

return Tools::displayError('The file is too large.');

break;

case 3:

return Tools::displayError('The file was partialy uploaded');

break;

case 4:

return Tools::displayError('The file is empty');

break;

}

}

}

/**

* Check image MIME type

*

* @param string $file $_FILE of the current file

* @param array $types Allowed MIME types

*/

function isPicture($file, $types = NULL)

{

/* Detect mime content type */

$mimeType = false;

if (!$types)

$types = array('image/gif', 'image/jpg', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png');

/* Try 4 different methods to determine the mime type */

if (function_exists('finfo_open'))

{

$const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME;

$finfo = finfo_open($const);

$mimeType = finfo_file($finfo, $file['tmp_name']);

finfo_close($finfo);

}

elseif (function_exists('mime_content_type'))

$mimeType = mime_content_type($file['tmp_name']);

elseif (function_exists('exec'))

{

$mimeType = trim(exec('file -b --mime-type '.escapeshellarg($file['tmp_name'])));

if (!$mimeType)

$mimeType = trim(exec('file --mime '.escapeshellarg($file['tmp_name'])));

if (!$mimeType)

$mimeType = trim(exec('file -bi '.escapeshellarg($file['tmp_name'])));

}

if (empty($mimeType) OR $mimeType == 'regular file' OR $mimeType == 'text/plain')

$mimeType = $file['type'];

/* For each allowed MIME type, we are looking for it inside the current MIME type */

foreach ($types AS $type)

if (strstr($mimeType, $type))

return true;

return false;

}

/**

* Check icon upload

*

* @param array $file Upload $_FILE value

* @param integer $maxFileSize Maximum upload size

*/

function checkIco($file, $maxFileSize)

{

if ($file['size'] > $maxFileSize)

return Tools::displayError('Image is too large').' ('.($file['size'] / 1000).'ko). '.Tools::displayError('Maximum allowed:').' '.($maxFileSize / 1000).'ko';

if (substr($file['name'], -4) != '.ico')

return Tools::displayError('Image format not recognized, allowed formats are: .ico');

if ($file['error'])

return Tools::displayError('Error while uploading image; please change your server\'s settings.');

return false;

}

/**

* Resize, cut and optimize image

*

* @param array $sourceFile Image object from $_FILE

* @param string $destFile Destination filename

* @param integer $destWidth Desired width (optional)

* @param integer $destHeight Desired height (optional)

*

* @return boolean Operation result

*/

function imageResize($sourceFile, $destFile, $destWidth = NULL, $destHeight = NULL, $fileType = 'jpg')

{

if (!file_exists($sourceFile))

return false;

list($sourceWidth, $sourceHeight, $type, $attr) = getimagesize($sourceFile);

// If PS_IMAGE_QUALITY is activated, the generated image will be a PNG with .jpg as a file extension.

// This allow for higher quality and for transparency. JPG source files will also benefit from a higher quality

// because JPG reencoding by GD, even with max quality setting, degrades the image.

if (Configuration::get('PS_IMAGE_QUALITY') == 'png_all'

|| (Configuration::get('PS_IMAGE_QUALITY') == 'png' && $type == IMAGETYPE_PNG))

$fileType = 'png';

 

if (!$sourceWidth)

return false;

if ($destWidth == NULL) $destWidth = $sourceWidth;

if ($destHeight == NULL) $destHeight = $sourceHeight;

$sourceImage = createSrcImage($type, $sourceFile);

$widthDiff = $destWidth / $sourceWidth;

$heightDiff = $destHeight / $sourceHeight;

if ($widthDiff > 1 AND $heightDiff > 1)

{

$nextWidth = $sourceWidth;

$nextHeight = $sourceHeight;

}

else

{

if (Configuration::get('PS_IMAGE_GENERATION_METHOD') == 2 OR (!Configuration::get('PS_IMAGE_GENERATION_METHOD') AND $widthDiff > $heightDiff))

{

$nextHeight = $destHeight;

$nextWidth = round(($sourceWidth * $nextHeight) / $sourceHeight);

$destWidth = (int)(!Configuration::get('PS_IMAGE_GENERATION_METHOD') ? $destWidth : $nextWidth);

}

else

{

$nextWidth = $destWidth;

$nextHeight = round($sourceHeight * $destWidth / $sourceWidth);

$destHeight = (int)(!Configuration::get('PS_IMAGE_GENERATION_METHOD') ? $destHeight : $nextHeight);

}

}

$destImage = imagecreatetruecolor($destWidth, $destHeight);

// If image is a PNG and the output is PNG, fill with transparency. Else fill with white background.

if ($fileType == 'png' && $type == IMAGETYPE_PNG)

{

imagealphablending($destImage, false);

imagesavealpha($destImage, true);

$transparent = imagecolorallocatealpha($destImage, 255, 255, 255, 127);

imagefilledrectangle($destImage, 0, 0, $destWidth, $destHeight, $transparent);

}else

{

$white = imagecolorallocate($destImage, 255, 255, 255);

imagefilledrectangle($destImage, 0, 0, $destWidth, $destHeight, $white);

Link to comment
Share on other sites

Hello to you too astaufik,

 

First can you edit your config.inc.php file

 

/* Debug only */

@ini_set('display_errors', 'off');

define('_PS_DEBUG_SQL_', false);

 

And set display_error to 'on', this way you can see error messages on your front office.

Link to comment
Share on other sites

Have you successfully entered into your back office, and after install did you use your FTP program to rename your administrator folder and delete the install folder. (install requirements)

You edit the front office (shop) through the BO.

Link to comment
Share on other sites

Ok lets say you installed prestashop to http://mysite.com/shop to get into back office you would go to http://mysite.com/shop/admin then enter the user name and password you created during install.

 

However before you can enter the back office you need to log onto your online files using an FTP program and delete the folder named install and rename the folder admin to administrator or backoffice or anything but it must be renamed.

 

Then your back office log in location might be: http://mysite.com/shop/backoffice orhttp://mysite.com/shop/administrator

Link to comment
Share on other sites

  • 2 weeks later...

I have same problem written originally, with the error messages (from the Prestashop error log):

 

Warning: require_once(/home/johnadk/public_html/webshop/tasc/../images.inc.php) [function.require-once]: failed to open stream: No such file or directory in/home/johnadk/public_html/webshop/tasc/functions.php on line 28

 

Fatal error: require_once() [function.require]: Failed opening required '/home/johnadk/public_html/webshop/tasc/../images.inc.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in/home/johnadk/public_html/webshop/tasc/functions.php on line 28

 

How do I make progress with this issue?

 

I cannot access my back office. Just returns the Internal Server Error 500, and Prestashop error log captures the above errors. I have not yet found any solution in these forums. I have installed v1.4.7.0 at a new hosting provider, Arvixe, which is advertised as being a good hosting provider for Prestashop.

 

Anyone have any ideas?

Link to comment
Share on other sites

I have finally managed to log onto my back office. I simply commented line 28 referred to above in functions.php. However, now I get Fatal Errors within the back office when attempting to save changes (e.g. to add logo icons, or access languages module). So that wasn't a useful solution.

 

What else could be the issue?

 

I have previously used one.com as hosting provider and the installation process worked pretty well. However, their php settings limited my ability to make additional translation changes. So I finally decided to change internet providers and selected Arvixe due to Prestashop listing them as a Prestashop hosting provider. But I have not yet managed to make a workable installation on their servers.

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...