ChrisColeman Posted July 21, 2017 Share Posted July 21, 2017 (edited) 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. Edited July 21, 2017 by ChrisColeman Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 21, 2017 Share Posted July 21, 2017 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. Quote Link to comment Share on other sites More sharing options...
havenswift-hosting Posted July 21, 2017 Share Posted July 21, 2017 It is likely to be that PHP 5.6 and PHP 7 are running different handlers and are creating the files with different ownership. Start from scratch and create the files again under both and check the permissions and ownership and also use the Server Info to check which PHP handler you are using Ian Quote Link to comment Share on other sites More sharing options...
ChrisColeman Posted July 25, 2017 Author Share Posted July 25, 2017 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. Quote Link to comment Share on other sites More sharing options...
havenswift-hosting Posted July 25, 2017 Share Posted July 25, 2017 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 Quote Link to comment Share on other sites More sharing options...
ChrisColeman Posted July 26, 2017 Author Share Posted July 26, 2017 (edited) 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, Backup the databases of my 3 cubecart 6 sites. Delete the CubeCart 6 folders from the server Switch those sites to SU (PHP 7) Reinstall CubeCart on those sites, any associated mods and DB 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 . Chris. Edited July 26, 2017 by ChrisColeman 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.