Jump to content

Not able to print invoices


traylor23

Recommended Posts

When I click the printer icon above a new order, I get a new browser window with this in the URL:

http://www.ballcardz.com/files/print.01b4adf4d73e8c806311d6cd01af4f97.php

and a display error of:

[an error occurred while processing this directive]

 

Any help would be appreciated.

 

Thanks,

 

  Matt

 

P.S. Nothing is showing up in the error log in Cubecart.  Will update if anything shows with my host.

Link to comment
Share on other sites

I am not yet sure what or where the source of "an error occurred while processing this directive" is coming from, but there should be an error generated by PHP if PHP cannot actually create this file.

 

You would not ever see this file in the /files/ folder because as soon as it is created, CubeCart instructs the browser to 302 Temporary fetch the file, and when the browser does, the last PHP instruction in that file is to delete itself.

 

In the file /admin/sources/orders.index.inc.php, near line 511, you can comment out:

$cleanup = '<?php unlink(__FILE__); ?>';

so that the file will not delete itself. This gives you the opportunity to see if the file actually exists. If not, then check for permissions issues.

Link to comment
Share on other sites

My entire, glorious PHP error log (about ready to start from scratch...ugh!):
 

[03-Jan-2015 12:41:09 America/Panama] PHP Warning:  natcasesort() expects parameter 1 to be array, null given in /home1/ballcard/public_html/admin/sources/products.index.inc.php on line 1268
[03-Jan-2015 12:41:09 America/Panama] PHP Warning:  Invalid argument supplied for foreach() in /home1/ballcard/public_html/admin/sources/products.index.inc.php on line 1269
[03-Jan-2015 12:41:19 America/Panama] PHP Notice:  cURL Error (0): Failed to connect to 2607:f8b0:4007:807::2004: Network is unreachable in /home1/ballcard/public_html/classes/request.class.php on line 255
[03-Jan-2015 12:41:21 America/Panama] PHP Notice:  cURL Error (0): Failed to connect to 2607:f8b0:4007:807::2004: Network is unreachable in /home1/ballcard/public_html/classes/request.class.php on line 255
[03-Jan-2015 12:41:23 America/Panama] PHP Notice:  GD::gdLoadFile - Unknown file type: /home1/ballcard/public_html/images/source/index.htm in /home1/ballcard/public_html/classes/gd.class.php on line 75
[03-Jan-2015 12:41:23 America/Panama] PHP Notice:  GD::gdLoadFile - Unknown file type: /home1/ballcard/public_html/images/source/Thumbs.db in /home1/ballcard/public_html/classes/gd.class.php on line 75
[03-Jan-2015 12:41:23 America/Panama] PHP Notice:  GD::gdLoadFile - Unknown file type: /home1/ballcard/public_html/images/source/index.htm in /home1/ballcard/public_html/classes/gd.class.php on line 75
[03-Jan-2015 12:41:23 America/Panama] PHP Notice:  GD::gdLoadFile - Unknown file type: /home1/ballcard/public_html/images/source/Thumbs.db in /home1/ballcard/public_html/classes/gd.class.php on line 75
[03-Jan-2015 12:41:24 America/Panama] PHP Notice:  cURL Error (0): Failed to connect to 2607:f8b0:4007:803::1012: Network is unreachable in /home1/ballcard/public_html/classes/request.class.php on line 255
[03-Jan-2015 12:41:34 America/Panama] PHP Warning:  array_merge() [<a href='http://docs.php.net/manual/en/function.array-merge.php'>function.array-merge.php</a>]: Argument #2 is not an array in /home1/ballcard/public_html/admin/sources/products.index.inc.php on line 1265
[03-Jan-2015 12:41:34 America/Panama] PHP Warning:  natcasesort() expects parameter 1 to be array, null given in /home1/ballcard/public_html/admin/sources/products.index.inc.php on line 1268
[03-Jan-2015 12:41:34 America/Panama] PHP Warning:  Invalid argument supplied for foreach() in /home1/ballcard/public_html/admin/sources/products.index.inc.php on line 1269
[03-Jan-2015 12:44:20 America/Panama] PHP Warning:  array_merge() [<a href='http://docs.php.net/manual/en/function.array-merge.php'>function.array-merge.php</a>]: Argument #1 is not an array in /home1/ballcard/public_html/classes/order.class.php on line 494
[03-Jan-2015 12:45:42 America/Panama] PHP Warning:  Invalid argument supplied for foreach() in /home1/ballcard/public_html/admin/sources/dashboard.index.inc.php on line 156
[03-Jan-2015 12:45:43 America/Panama] PHP Warning:  Invalid argument supplied for foreach() in /home1/ballcard/public_html/admin/sources/dashboard.index.inc.php on line 156
[03-Jan-2015 12:56:16 America/Panama] PHP Warning:  Invalid argument supplied for foreach() in /home1/ballcard/public_html/admin/sources/dashboard.index.inc.php on line 156
[03-Jan-2015 13:07:17 America/Panama] PHP Warning:  Invalid argument supplied for foreach() in /home1/ballcard/public_html/admin/sources/dashboard.index.inc.php on line 156
[03-Jan-2015 13:10:37 America/Panama] PHP Warning:  Invalid argument supplied for foreach() in /home1/ballcard/public_html/admin/sources/dashboard.index.inc.php on line 156
[03-Jan-2015 13:21:25 America/Panama] PHP Warning:  Invalid argument supplied for foreach() in /home1/ballcard/public_html/admin/sources/dashboard.index.inc.php on line 156
[03-Jan-2015 13:36:25 America/Panama] PHP Parse error:  syntax error, unexpected end of file in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 657
[03-Jan-2015 13:36:29 America/Panama] PHP Parse error:  syntax error, unexpected end of file in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 657
[03-Jan-2015 13:36:35 America/Panama] PHP Parse error:  syntax error, unexpected end of file in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 657
[03-Jan-2015 13:36:37 America/Panama] PHP Parse error:  syntax error, unexpected end of file in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 657
[03-Jan-2015 13:36:48 America/Panama] PHP Parse error:  syntax error, unexpected end of file in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 657
[03-Jan-2015 13:36:55 America/Panama] PHP Parse error:  syntax error, unexpected end of file in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 657
[03-Jan-2015 13:38:01 America/Panama] PHP Parse error:  syntax error, unexpected end of file in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 657
[03-Jan-2015 13:38:03 America/Panama] PHP Parse error:  syntax error, unexpected end of file in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 657
[03-Jan-2015 13:38:05 America/Panama] PHP Parse error:  syntax error, unexpected end of file in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 657
[03-Jan-2015 13:39:01 America/Panama] PHP Warning:  Invalid argument supplied for foreach() in /home1/ballcard/public_html/admin/sources/dashboard.index.inc.php on line 156
[03-Jan-2015 13:45:14 America/Panama] PHP Parse error:  syntax error, unexpected '$template_file' (T_VARIABLE) in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 657
Link to comment
Share on other sites

Latest PHP Error Log:

 

[03-Jan-2015 12:41:19 America/Panama] PHP Notice:  cURL Error (0): Failed to connect to 2607:f8b0:4007:807::2004: Network is unreachable in /home1/ballcard/public_html/classes/request.class.php on line 255
[03-Jan-2015 12:41:21 America/Panama] PHP Notice:  cURL Error (0): Failed to connect to 2607:f8b0:4007:807::2004: Network is unreachable in /home1/ballcard/public_html/classes/request.class.php on line 255
[03-Jan-2015 12:41:23 America/Panama] PHP Notice:  GD::gdLoadFile - Unknown file type: /home1/ballcard/public_html/images/source/index.htm in /home1/ballcard/public_html/classes/gd.class.php on line 75
[03-Jan-2015 12:41:23 America/Panama] PHP Notice:  GD::gdLoadFile - Unknown file type: /home1/ballcard/public_html/images/source/Thumbs.db in /home1/ballcard/public_html/classes/gd.class.php on line 75
[03-Jan-2015 12:41:23 America/Panama] PHP Notice:  GD::gdLoadFile - Unknown file type: /home1/ballcard/public_html/images/source/index.htm in /home1/ballcard/public_html/classes/gd.class.php on line 75
[03-Jan-2015 12:41:23 America/Panama] PHP Notice:  GD::gdLoadFile - Unknown file type: /home1/ballcard/public_html/images/source/Thumbs.db in /home1/ballcard/public_html/classes/gd.class.php on line 75
[03-Jan-2015 12:41:24 America/Panama] PHP Notice:  cURL Error (0): Failed to connect to 2607:f8b0:4007:803::1012: Network is unreachable in /home1/ballcard/public_html/classes/request.class.php on line 255
[03-Jan-2015 12:41:34 America/Panama] PHP Warning:  array_merge() [<a href='http://docs.php.net/manual/en/function.array-merge.php'>function.array-merge.php</a>]: Argument #2 is not an array in /home1/ballcard/public_html/admin/sources/products.index.inc.php on line 1265
[03-Jan-2015 12:41:34 America/Panama] PHP Warning:  natcasesort() expects parameter 1 to be array, null given in /home1/ballcard/public_html/admin/sources/products.index.inc.php on line 1268
[03-Jan-2015 12:41:34 America/Panama] PHP Warning:  Invalid argument supplied for foreach() in /home1/ballcard/public_html/admin/sources/products.index.inc.php on line 1269
[03-Jan-2015 12:44:20 America/Panama] PHP Warning:  array_merge() [<a href='http://docs.php.net/manual/en/function.array-merge.php'>function.array-merge.php</a>]: Argument #1 is not an array in /home1/ballcard/public_html/classes/order.class.php on line 494
[03-Jan-2015 12:45:42 America/Panama] PHP Warning:  Invalid argument supplied for foreach() in /home1/ballcard/public_html/admin/sources/dashboard.index.inc.php on line 156
[03-Jan-2015 12:45:43 America/Panama] PHP Warning:  Invalid argument supplied for foreach() in /home1/ballcard/public_html/admin/sources/dashboard.index.inc.php on line 156
[03-Jan-2015 12:56:16 America/Panama] PHP Warning:  Invalid argument supplied for foreach() in /home1/ballcard/public_html/admin/sources/dashboard.index.inc.php on line 156
[03-Jan-2015 13:07:17 America/Panama] PHP Warning:  Invalid argument supplied for foreach() in /home1/ballcard/public_html/admin/sources/dashboard.index.inc.php on line 156
[03-Jan-2015 13:10:37 America/Panama] PHP Warning:  Invalid argument supplied for foreach() in /home1/ballcard/public_html/admin/sources/dashboard.index.inc.php on line 156
[03-Jan-2015 13:21:25 America/Panama] PHP Warning:  Invalid argument supplied for foreach() in /home1/ballcard/public_html/admin/sources/dashboard.index.inc.php on line 156
[03-Jan-2015 13:36:25 America/Panama] PHP Parse error:  syntax error, unexpected end of file in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 657
[03-Jan-2015 13:36:29 America/Panama] PHP Parse error:  syntax error, unexpected end of file in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 657
[03-Jan-2015 13:36:35 America/Panama] PHP Parse error:  syntax error, unexpected end of file in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 657
[03-Jan-2015 13:36:37 America/Panama] PHP Parse error:  syntax error, unexpected end of file in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 657
[03-Jan-2015 13:36:48 America/Panama] PHP Parse error:  syntax error, unexpected end of file in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 657
[03-Jan-2015 13:36:55 America/Panama] PHP Parse error:  syntax error, unexpected end of file in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 657
[03-Jan-2015 13:38:01 America/Panama] PHP Parse error:  syntax error, unexpected end of file in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 657
[03-Jan-2015 13:38:03 America/Panama] PHP Parse error:  syntax error, unexpected end of file in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 657
[03-Jan-2015 13:38:05 America/Panama] PHP Parse error:  syntax error, unexpected end of file in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 657
[03-Jan-2015 13:39:01 America/Panama] PHP Warning:  Invalid argument supplied for foreach() in /home1/ballcard/public_html/admin/sources/dashboard.index.inc.php on line 156
[03-Jan-2015 13:45:14 America/Panama] PHP Parse error:  syntax error, unexpected '$template_file' (T_VARIABLE) in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 657
[03-Jan-2015 14:52:41 America/Panama] PHP Warning:  Invalid argument supplied for foreach() in /home1/ballcard/public_html/admin/sources/dashboard.index.inc.php on line 156
[03-Jan-2015 15:08:19 America/Panama] PHP Warning:  Invalid argument supplied for foreach() in /home1/ballcard/public_html/admin/sources/dashboard.index.inc.php on line 156
Link to comment
Share on other sites

Most of these errors are known and can be ignored.

 

This one:

syntax error, unexpected '$template_file' (T_VARIABLE) in /admin/sources/orders.index.inc.php on line 657

is interesting.

 

As is this one:

syntax error, unexpected end of file in /admin/sources/orders.index.inc.php on line 657

 

In CC5214 unmodified, the line that should be commented for our experiment is line 497.

 

Here's an interesting thought....

 

Line 497 is: $cleanup = '<?php unlink(__FILE__); ?>';

 

This is a valid PHP statement. When PHP enters the quote mode, everything that follows the quote, up to the closing quote, is assigned to the variable. Note specifically the PHP code block closing delimiter ?>. It is part of the string.

 

However, when made into a single line comment, PHP is supposed to ignore the rest of the line. Namely, PHP does not enter the quote mode.

// $cleanup = '<?php unlink(__FILE__); ?>';

It has been my experience (which I now recall dealing with this) that PHP will still honor the PHP code block closing delimiter ?>. It's counter-intuitive.

 

Let's try this statement:

/* $cleanup = '<?php unlink(__FILE__); ?>'; */

Hopefully, this block comment will have PHP reliably ignore everything between those delimiters.

Link to comment
Share on other sites

That generated these errors, after showing a blank screen:
 

[03-Jan-2015 16:07:30 America/Panama] PHP Warning:  Invalid argument supplied for foreach() in /home1/ballcard/public_html/admin/sources/dashboard.index.inc.php on line 156
[03-Jan-2015 16:07:36 America/Panama] PHP Warning:  Unterminated comment starting line 497 in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 497
[03-Jan-2015 16:07:36 America/Panama] PHP Parse error:  syntax error, unexpected end of file in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 657
[03-Jan-2015 16:07:40 America/Panama] PHP Warning:  Unterminated comment starting line 497 in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 497
[03-Jan-2015 16:07:40 America/Panama] PHP Parse error:  syntax error, unexpected end of file in /home1/ballcard/public_html/admin/sources/orders.index.inc.php on line 657
[03-Jan-2015 16:07:51 America/Panama] PHP Warning:  Invalid argument supplied for foreach() in /home1/ballcard/public_html/admin/sources/dashboard.index.inc.php on line 156
Link to comment
Share on other sites

Ok...my bad, Brian...I didn't have the */ at the end.  Oops...ok...so now it's fixed...

After clicking the printer icon on top of the specific order page (in this case, order #150103-122605-5001), which generates this link:

/admin.php?_g=orders&node=index&print[]=150103-122605-5001

it generates this error message from this URL:

/files/print.01b4adf4d73e8c806311d6cd01af4f97.php
 

[an error occurred while processing this directive]

 

Stumped...

when checking the newest PHP errors:

 

[03-Jan-2015 16:29:27 America/Panama] PHP Warning:  Invalid argument supplied for foreach() in /home1/ballcard/public_html/admin/sources/dashboard.index.inc.php on line 156

[03-Jan-2015 16:30:00 America/Panama] PHP Warning:  Invalid argument supplied for foreach() in /home1/ballcard/public_html/admin/sources/dashboard.index.inc.php on line 156
Link to comment
Share on other sites

Googling this error, I am thinking there may be some thing about the PHP or HTML code that the web server does not like.

 

Have you made any edits to /admin/skins/default/templates/orders.print.php?

 

Can you email me a copy of files/print.01b4adf4d73e8c806311d6cd01af4f97.php?

Link to comment
Share on other sites

Please delete the code in post #14. I don't need to see that file, and I prefer you email the file I asked to see.


The code in post #14 is not from:

/admin/skins/default/templates/orders.print.php

 

However, if what you posted is from that file, then you need to restore /admin/skins/default/templates/orders.print.php from a good copy.


Also, using the FTP utility, let us know if the permissions to /files/print.01b4adf4d73e8c806311d6cd01af4f97.php are correct.

Link to comment
Share on other sites

Please delete the code in post #14. I don't need to see that file, and I prefer you email the file I asked to see.

The code in post #14 is not from:

/admin/skins/default/templates/orders.print.php

 

However, if what you posted is from that file, then you need to restore /admin/skins/default/templates/orders.print.php from a good copy.

Also, using the FTP utility, let us know if the permissions to /files/print.01b4adf4d73e8c806311d6cd01af4f97.php are correct.

Working on getting a good copy of /orders.print.php

also, permissions on print file is 644

Link to comment
Share on other sites

ugh...no..lol....been messing with cubecart for 5 years now and feel like a total newb at times.  Thanks, Brian...I'll try it.


Brian, just deleted the file, cleared cache from the maintenance tab (all selections checked), retried printing invoice and got the same error...generated the same URL for that order.

Link to comment
Share on other sites

The whole stupid time, this was caused by the permissions on my /files directory having 775 permissions, instead of 755.  Fixed that and now everything works flawlessly...silly Cubecart and my host.  Thank you so very much for your time, Brian.  Wish there were some way that ALL of us could repay you!

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