Jump to content

Resolved - Printing Order = 500 Internal Server Error


grafis

Recommended Posts

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?

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.   Paste as plain text instead

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