n1concepts Posted June 17, 2011 Share Posted June 17, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/239691-no-such-file-or-directory-issues-error-but-only-on-specific-server/ Share on other sites More sharing options...
fugix Posted June 17, 2011 Share Posted June 17, 2011 Normally I recommend using $_SERVER['DOCUMENT_ROOT'] in your actual pathing. Can you post the code where you are receiving the errors on this thread please Quote Link to comment https://forums.phpfreaks.com/topic/239691-no-such-file-or-directory-issues-error-but-only-on-specific-server/#findComment-1231274 Share on other sites More sharing options...
n1concepts Posted June 17, 2011 Author Share Posted June 17, 2011 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/'); Quote Link to comment https://forums.phpfreaks.com/topic/239691-no-such-file-or-directory-issues-error-but-only-on-specific-server/#findComment-1231279 Share on other sites More sharing options...
n1concepts Posted June 18, 2011 Author Share Posted June 18, 2011 I figured out the issues - several GD support extentions missingo on server. Also, relative path not working correctly; needed to set absolute paths. This matter can be closed. thx! Quote Link to comment https://forums.phpfreaks.com/topic/239691-no-such-file-or-directory-issues-error-but-only-on-specific-server/#findComment-1231466 Share on other sites More sharing options...
fugix Posted June 18, 2011 Share Posted June 18, 2011 Sidenote. You can use phpinfo() to confirm that the proper extensions etc are compiled in the php that each server is using. Quote Link to comment https://forums.phpfreaks.com/topic/239691-no-such-file-or-directory-issues-error-but-only-on-specific-server/#findComment-1231499 Share on other sites More sharing options...
n1concepts Posted June 18, 2011 Author Share Posted June 18, 2011 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>"; Quote Link to comment https://forums.phpfreaks.com/topic/239691-no-such-file-or-directory-issues-error-but-only-on-specific-server/#findComment-1231547 Share on other sites More sharing options...
fugix Posted June 18, 2011 Share Posted June 18, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/239691-no-such-file-or-directory-issues-error-but-only-on-specific-server/#findComment-1231572 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.