Jump to content

PHP 7 and Print Order Problem ..


ChrisColeman

Recommended Posts

Hi,

after upgrading my server to PHP 7 I cannot print orders ..

 I receive a server 500 error ..

In the php error log I can see -

 

Quote

file_put_contents(/home/janda/public_html/files/print.f01d5aa282dceded2260c3eb038e4c14.php) [<a href='http://docs.php.net/manual/en/function.file-put-contents.php'>function.file-put-contents.php</a>]: failed to open stream: Permission denied in /home/janda/public_html/admin/sources/orders.index.inc.php on line 601, referer: https://www.jandasupplies.co.uk/admin.php?_g=orders&node=index&sort[order_date]=DESC&action=edit&order_id=170719-190018-2268

 

Which is a bit strange because the printfile is alive and well in exactly the same location, ie. it just will not print.

 

I can luckily switch back to PHP (5.6) fairly easily.

 

But still I cannot print the file (funny it used to work), so I delete the print file which was left behind by PHP 7, and try to print again - This time success.

 

Any ideas - I would like to upgrade PHP  on all 6or7 cubecart sites I am running.

 

Many Thanks.

 

Chris Coleman.

 

 

Capture.PNG

Edited by ChrisColeman
Link to comment
Share on other sites

The 500ISE is just the web browser reporting that, generally, something went wrong - and as is revealed by the eror message, PHP crashed with a permissions issue.

Please determine the CHMOD values of the file CubeCart created. You may also need to get your hosting provider to help in determining who "owns" that file which is part of the permissions. But I have no answer why PHP7 vs. PHP5 might be the source of the permissions disagreement.

Link to comment
Share on other sites

Hi,

   thanks to Ian - I can now see the problem ..

The handler for php 7 changed to PHPSU, before it was DSO.

One question, can I just change the handler, or would it be better  to go with PHPSU and solve any problems as they present ..

Of course another option would be to reinstall all of my CubeCart sites using a database backup and PHPSU, I guess that would fix it?

Thanks, Chris.

 

 

Link to comment
Share on other sites

suPHP executes processes as the hosting user id and therefore all files are owned by that user and no other user on the server has access to them. DSO executes as the generic user "nobody" as will every process for every other user on that server, meaning it is far less secure.  If you switch between php versions that use different handlers then you will have a huge number of permission problems

Ian

Link to comment
Share on other sites

Yes - I did a bit of digging araound, I hope this is not too far off topic but figured it might be useful to someone  ..

By the way thanks to IAN for pointing me in the right direction on this, I  have my own server and considerable experience in the computer industry but only a litte with Linux or Apache, anything I know about Linux has been self taught over the last 6 years or so, it never occurred to me that PHP handlers could be changed ..

Only one version of PHP can be configured with the DSO handler, and unlimited versions can run with SU, but I need to run multiple versions in order to support some old websites (CubeCart and Others)..

The old websites require the DSO handler, or cannot easily use the SU handler .

CubeCart installed on a server running DSO will not transfer to a server running SU (again not easilly), maybe if I ran an upgrade on a CubeCart 6 version after moving it to SU that would solve the problem - I dont know ?

Anyway CubeCart installed  on a server already running SU seems to install correctly.

So my best option is to,

  1. Backup the databases of my 3 cubecart 6 sites.
  2. Delete the CubeCart 6 folders from the server
  3. Switch those sites to SU (PHP 7)
  4. Reinstall CubeCart on those sites, any associated mods and DB
  5. Delete the setup directory

Actually about an hours work/site so if I do site by site not a big deal.

By the way I noticed something else - If you try to recover a PHP DSO site to a PHP SU site - you'll get lots of permission errors :detective2:.

Chris.

Edited by ChrisColeman
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...