Jump to content

No such file or directory Issues Error but only on specific server


n1concepts

Recommended Posts

I'm trying to get this shopping cart code to work (which run just fine on Godaddy, HostGator, etc...) but not on our internal server.

Code can be found at: http://www.phpwebcommerce.com/

 

Here's just one of the errors I'm getting when I try to modify an existing product (add picture to that product):

 

===============

Warning: move_uploaded_file(images/product/86312ce6d19dc0c05588be2dab749123.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in /users/tcraig1/PHPSQL1/Final/shoppingcart/admin/product/processProduct.php on line 80

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpEqriFS' to 'images/product/86312ce6d19dc0c05588be2dab749123.jpg' in /users/tcraig1/PHPSQL1/Final/shoppingcart/admin/product/processProduct.php on line 80

Warning: Cannot modify header information - headers already sent by (output started at /users/tcraig1/PHPSQL1/Final/shoppingcart/admin/product/processProduct.php:80) in /users/tcraig1/PHPSQL1/Final/shoppingcart/admin/product/processProduct.php on line 145

=============

 

Again, if code is loaded to any random 3rd party hosting account, it work just fine - everything.

However, code fails to run on this specific account; I know it's probably a server configuration issue - to which I do not have the ability to change, etc... but need to identify the problem to report to administrators to have fixed.

 

I printed out the following to confirm path location (see below):

$_SERVER[sERVER_NAME]:                        tcraig1.userworld.com

$_SERVER[REQUEST_URI]:                        /PHPSQL1/Final/shoppingcart/urlcheck.php

$_SERVER[DOCUMENT_ROOT]:                /users/tcraig1/

__FILE__:                                                /users/tcraig1/PHPSQL1/Final/shoppingcart/urlcheck.php

 

 

Can anyone advise based on the provided code link: http://www.phpwebcommerce.com

The error is produced once you are logged in as "admin" and attempt to update a product image to the item.

Link to comment
Share on other sites

Hi,

 

I just emailed you the zipped files - I know it's a path issue but not sure how to approach (find the issue which I think is in the config.php)

I'm looking at below lines of code which is found in the /library/config.php file:

 

// setting up the web root and server root for
// this shopping cart application
$thisFile = str_replace('\\', '/', '');
$docRoot = $_SERVER['SERVER_NAME'];

$webRoot  = str_replace(array($docRoot, 'library/config.php'), '', $thisFile);
$srvRoot  = str_replace('library/config.php', '', $thisFile);

define('WEB_ROOT', $webRoot);
//define('SRV_ROOT', $srvRoot);

// these are the directories where we will store all
// category and product images
define('CATEGORY_IMAGE_DIR', 'images/category/');
define('PRODUCT_IMAGE_DIR',  'images/product/');

Link to comment
Share on other sites

Yes, i actually used the following which immediately confirmed what was / was not enabled.

 

if (extension_loaded('gd') && function_exists('gd_info')) {
    echo "It looks like GD is installed";
}
echo "<br />";
echo "<pre>"; var_dump(gd_info()); echo "</pre>";

Link to comment
Share on other sites

Yes that will work as well as long as you are aware of the extensions that your php needs to function properly. As a sidenote, you can also use extension_loaded('gd')

Which also checks for specific extension loads

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.