grafis Posted October 7, 2012 Share Posted October 7, 2012 Clicking Print icon for any order generates the following error: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Apache Server at www.xxxxxxxxxxxxxxxx.com Port 443 Files folder is 777 and the following file is an example that the process generates: print.59e8556ff82e8d8dae62a9912699205a.php The file contains all pertinent information as expected and appears to be properly formatted, the only thing odd is the very last line of the file outside of the closing HTML tag is this: <?php unlink(__FILE__); ?> No error's are generated in the server error log file. There's another post here from 2011 with the same error noting that it should be reported as a bug. Anyone else have this issue and how to resolve? Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 7, 2012 Share Posted October 7, 2012 I'm sorry you're having such difficulties, but someone who can help will need to know that you have just upgraded. One of your other posts had ... upgrading from 4.3.7 to 5.1.4. Please edit your sig so Bsmither or whoever replies will know that. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 7, 2012 Share Posted October 7, 2012 Would you please look at that print.xxx.php file once more and let us know what the actual HTML looks like at these two places: Near the top: <div id="storeLabel"> <img src="{$STORE_LOGO}" alt="" /> </div> and also near the bottom: <div id="storeLabel"> <img src="../images/logos/{$SKIN}.php" alt="" /> </div> Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 7, 2012 Share Posted October 7, 2012 Concerning the three lines in two places as identified in the previous post, would you please make the bottom three lines look like the top three lines in the file /admin/skins/default/templates/orders.print.php. Quote Link to comment Share on other sites More sharing options...
grafis Posted October 7, 2012 Author Share Posted October 7, 2012 Thank you for the help bsmither. printxxxx.php - only calls an image once. At the top lines 22-24 look like this: <div id="storeLabel"> <img src="https://www.luciasimports.com/images/logos/Lucias-Imports.png" alt="" /> </div> At the very bottom there is this: </div> </body> </html><?php unlink(__FILE__); ?> /admin/skins/default/templates/orders.print.php. Changed the second (if no notes...) logo code to look like the first, uploaded with the same result, 500 error and same HTML Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 7, 2012 Share Posted October 7, 2012 I checked the print.order.php file straight from the 5.1.4 download, and there is no code like </html><?php unlink(__FILE__); ?> Have you tried just deleting it, or at least commenting it out to see what happens? Also, you don't have to put the actual path to your store logo in - you can leave it as <img src="{$STORE_LOGO}" alt="" /> in both places the store logo appears in the stock printout. I did add {$META_TITLE} to the alt, and in my version I left off the second logo - that never did make sense to me. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 7, 2012 Share Posted October 7, 2012 No, not at the very bottom. And I haven't had my 14th cup of coffee yet. Sorry. Messed up my response badly. In the Cubecart file adminskinsdefaulttemplatesorders.print.php at around line 82, find: <div id="storeLabel"> <img src="../images/logos/{$SKIN}.php" alt="" /> </div> Change that to: <div id="storeLabel"> <img src="{$STORE_LOGO}" alt="" /> </div> Now, I can see a crash if the order contains notes. If there are no notes, then there won't be any HTML present that codes for a second page to be printed and the bad method of asking for an image for that second page. I can't find a file named print.order.php. This file, orders.print.php is actually a template and the last bit (the unlink() statement) is added under the control of the controller code for this template. Quote Link to comment Share on other sites More sharing options...
grafis Posted October 7, 2012 Author Share Posted October 7, 2012 No, not at the very bottom. And I haven't had my 14th cup of coffee yet. Sorry. Messed up my response badly. In the Cubecart file adminskinsdefaulttemplatesorders.print.php at around line 82, find: <div id="storeLabel"> <img src="../images/logos/{$SKIN}.php" alt="" /> </div> Change that to: <div id="storeLabel"> <img src="{$STORE_LOGO}" alt="" /> </div> Now, I can see a crash if the order contains notes. If there are no notes, then there won't be any HTML present that codes for a second page to be printed and the bad method of asking for an image for that second page. I can't find a file named print.order.php. This file, orders.print.php is actually a template and the last bit (the unlink() statement) is added under the control of the controller code for this template. Sorry if I wasn't clear but I did that with no change: /admin/skins/default/templates/orders.print.php. Changed the second (if no notes...) logo code to look like the first, uploaded with the same result, 500 error and same HTML Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 7, 2012 Share Posted October 7, 2012 Sorry, it is orders.print.php I was talking about. I misunderstood, thinking that odd code actually showed on grafis' php file. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 7, 2012 Share Posted October 7, 2012 I see that you did find the pertinent code in the template file and changed it. Excellent. What I would like to see is a copy of the print.xxxx.php file. Could you email that to me? I'll send my email in a private message. Quote Link to comment Share on other sites More sharing options...
grafis Posted October 7, 2012 Author Share Posted October 7, 2012 CC Support just came through with the solution!! "Please change folder permissions to 755 as it seems your site is running suPHP and 777 permissions are not permitted." Thanks for all the help and feedback. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 7, 2012 Share Posted October 7, 2012 You mention the files folder is 777. And the file ends in a suffix of .php. Please send an urgent message to your hosting provider and ask if they permit an executable script to be launched from a 777 folder. If they say they don't permit that (which would be why you are getting a 500 error), ask them to suggest the number sequence to use. ---------------------------- Please add the fact that your site is under the control of suPHP to your signature. Quote Link to comment Share on other sites More sharing options...
grafis Posted October 7, 2012 Author Share Posted October 7, 2012 You mention the files folder is 777. And the file ends in a suffix of .php. Please send an urgent message to your hosting provider and ask if they permit an executable script to be launched from a 777 folder. If they say they don't permit that (which would be why you are getting a 500 error), ask them to suggest the number sequence to use. ---------------------------- Please add the fact that your site is under the control of suPHP to your signature. That was it - 755 worked. CubeCart support said it's because I have suPHP. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 7, 2012 Share Posted October 7, 2012 I'll mark this as Resolved - glad for your sake - but you do need to add this suPHP info to your sig. It will save a lot of time if you have problems in the future. Quote Link to comment Share on other sites More sharing options...
grafis Posted October 8, 2012 Author Share Posted October 8, 2012 I'll mark this as Resolved - glad for your sake - but you do need to add this suPHP info to your sig. It will save a lot of time if you have problems in the future. Sorry but I didn't know I had suPHP until CubeCart Tech Support told me. My sig info is straight from CubeCart Dashboard page which doesn't mention suPHP (see below), nor does the CubeCart Server info page or my host's admin page. Any idea where or how I would find out? I'd never heard of it until today. Technical Details CubeCart Version 5.1.4 PHP Version 5.2.17 MySQL Version 50165 Image folder size 150.2 MB Download folder size 10 MB Max. Upload filesize 10M Browser user-agent Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4 Server Software Apache Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 8, 2012 Share Posted October 8, 2012 I don't have a clue! I've never heard of suPHP and still don't know what it means, but I'm not at all knowledgeable. Obviously Bsmither knew exactly what it means. Quote Link to comment Share on other sites More sharing options...
grafis Posted October 8, 2012 Author Share Posted October 8, 2012 I had to look it up. http://suphp.org/ "suPHP is a tool for executing PHP scripts with the permissions of their owners. It consists of an Apache module (mod_suphp) and a setuid root binary (suphp) that is called by the Apache module to change the uid of the process executing the PHP interpreter." Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 8, 2012 Share Posted October 8, 2012 I've been reading about it, too. Sounds like a good idea! I've always thought that 777 permission was kind of odd, but I know so little I just shrugged off my misgivings. Quote Link to comment 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.