Koozali.org: home of the SME Server

PHP-SCL - permissions and ownership for 7.2 and 7.3 in /usr/bin/phpscl

Offline stefangk

  • 20
  • +0/-0
I was playing with "new" 7.2 and 7.3 PHP versions from php-scl contribs. When enabled 7.2 for one of my webapps I got this error: "(13)Permission denied: exec of '/usr/bin/phpscl/php72_REMI' failed".

Changing permissions and ownership like for previous versions work fine, but it would be good if they work after updating php-scl with any new version of PHP.
Stefan Krastanov

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: PHP-SCL - permissions and ownership for 7.2 and 7.3 in /usr/bin/phpscl
« Reply #1 on: December 09, 2018, 12:15:32 PM »
Hmmm..... what caused this in the first place, and what did you change the permissions on?

If you modded php itself you may have created yourself a security issue as the permissions should be correct.

Go back to the start and explain what happened
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline stefangk

  • 20
  • +0/-0
Re: PHP-SCL - permissions and ownership for 7.2 and 7.3 in /usr/bin/phpscl
« Reply #2 on: December 09, 2018, 05:46:55 PM »
Hmmm..... what caused this in the first place, and what did you change the permissions on?

If you modded php itself you may have created yourself a security issue as the permissions should be correct.

Go back to the start and explain what happened

I was curious too, but tracking error message I went to /usr/bin/phpscl and found that other script have same template of permissions and ownerships, but for 7.2 and 7.3 it was not applied.

Then I followed the template and apache was able to call correct version of PHP. It looks like update script does its work partially.
« Last Edit: December 10, 2018, 10:08:40 PM by stefangk »
Stefan Krastanov

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: PHP-SCL - permissions and ownership for 7.2 and 7.3 in /usr/bin/phpscl
« Reply #3 on: December 10, 2018, 11:12:32 PM »
I'll ask again as you still have not explained.

Please tell us exactly what you did to install this and what you did to get the error.

Which wiki page did you follow.
What commands did you use.

You should not have to change ANY permissions.

Once we know what happened we can see if it was an installation error and try to fix it if necessary.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline stefangk

  • 20
  • +0/-0
Re: PHP-SCL - permissions and ownership for 7.2 and 7.3 in /usr/bin/phpscl
« Reply #4 on: December 10, 2018, 11:23:56 PM »
It is strange way you are asking. A year or so I installed PHP Software Collections (php-scl) contrib. It was updated several times since then. So I got not only updates to php 5.6, 7.0, 7.1 but also new versions like 7.2 and 7.3 recently.

I thought that it will update everything automatically and setup new php versions as well. Obviously I was wrong.

7.2 and 7.3 were installed but not correctly. That is the story. Everything else is in my initial post.

Hope that clear any confusion. 
« Last Edit: December 10, 2018, 11:26:06 PM by stefangk »
Stefan Krastanov

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: PHP-SCL - permissions and ownership for 7.2 and 7.3 in /usr/bin/phpscl
« Reply #5 on: December 11, 2018, 12:55:32 AM »
It is strange way you are asking. A year or so I installed PHP Software Collections (php-scl) contrib. It was updated several times since then. So I got not only updates to php 5.6, 7.0, 7.1 but also new versions like 7.2 and 7.3 recently.

I thought that it will update everything automatically and setup new php versions as well. Obviously I was wrong.

7.2 and 7.3 were installed but not correctly. That is the story. Everything else is in my initial post.

Hope that clear any confusion. 

Yup - makes more sense now thanks

I think normally you would use the remi-safe repo which is always enabled and if there are updates to the core php files you will get them

The SME php contrib specifically enables the PHP versions. We try to keep it up to date as new version s get released.

So when we say get php 7.4 then the sme contrib will get and update and then the correct rpms are pulled in from remi-safe. Hope that makes some sense.

Just had a look and can see this

ll /usr/bin/phpscl
total 28
-rwxrwx--- 1 root www  55 Feb 22  2015 php54_REMI
-rwxrwx--- 1 root www  55 Feb 22  2015 php55_REMI
-rwxrwx--- 1 root www  55 Feb 22  2015 php56_REMI
-rwxrwx--- 1 root www  55 Aug 15 21:23 php70_REMI
-rwxrwx--- 1 root www  55 Aug 15 21:23 php71_REMI
-rw-r--r-- 1 root root 55 Aug 15 21:23 php72_REMI
-rw-r--r-- 1 root root 55 Aug 15 21:23 php73_REMI


So yes it seems that for whatever good reason they have been installed with different ownership and permissions.

That's a bug and I can see why in the rpm spec file. I'll fix that ASAP.

To test if any given version is basically working you should use this on the CLI

php56 -v
php70 -v
php71 -v
php72 -v
php73 -v

etc.

[root@test]# php73 -v
PHP 7.3.0 (cli) (built: Dec  4 2018 18:26:59) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies

So we know the basics are there and running.

You then need to apply it globally or per ibay through the server manager (or CLI)

https://bugs.contribs.org/show_bug.cgi?id=10662

It should be in smetest tomorrow - follow the bug for progress.

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline stefangk

  • 20
  • +0/-0
Re: PHP-SCL - permissions and ownership for 7.2 and 7.3 in /usr/bin/phpscl
« Reply #6 on: December 11, 2018, 06:17:41 AM »
Thanks a lot. I'll test new release ASAP.
Stefan Krastanov

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: PHP-SCL - permissions and ownership for 7.2 and 7.3 in /usr/bin/phpscl
« Reply #7 on: December 11, 2018, 07:14:24 AM »
Got some dependency errors coming up, might be worth just waiting a little longer

--> Finished Dependency Resolution
Error: Package: php72-php-pecl-mcrypt-1.0.1-4.el6.remi.x86_64 (remi-safe)
           Requires: libmcrypt.so.4()(64bit)
Error: Package: php71-php-mcrypt-7.1.25-2.el6.remi.x86_64 (remi-safe)
           Requires: libmcrypt.so.4()(64bit)
Error: Package: gd-last-2.2.5-5.el6.remi.x86_64 (remi-safe)
           Requires: libwebp.so.5()(64bit)
Error: Package: php54-php-mcrypt-5.4.45-16.el6.remi.x86_64 (remi-safe)
           Requires: libmcrypt.so.4()(64bit)
Error: Package: php55-php-mcrypt-5.5.38-10.el6.remi.x86_64 (remi-safe)
           Requires: libmcrypt.so.4()(64bit)
Error: Package: php70-php-mcrypt-7.0.33-1.el6.remi.x86_64 (remi-safe)
           Requires: libmcrypt.so.4()(64bit)
Error: Package: php56-php-mcrypt-5.6.39-1.el6.remi.x86_64 (remi-safe)
           Requires: libmcrypt.so.4()(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
« Last Edit: December 11, 2018, 07:17:45 AM by TerryF »
--
qui scribit bis legit

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: PHP-SCL - permissions and ownership for 7.2 and 7.3 in /usr/bin/phpscl
« Reply #8 on: December 11, 2018, 07:31:56 AM »
Needed the epel repo as well..

yum install smeserver-php-scl --enablerepo=smetest,epel,remi-safe

Added warning: remember this is a test rpm, careful will robinson :-)
--
qui scribit bis legit

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: PHP-SCL - permissions and ownership for 7.2 and 7.3 in /usr/bin/phpscl
« Reply #9 on: December 11, 2018, 07:48:22 AM »
So, looks good:

[root@sme92x64 ~]# ll /usr/bin/phpscl
total 28
-rwxrwx--- 1 root www 55 Feb 23  2015 php54_REMI
-rwxrwx--- 1 root www 55 Feb 23  2015 php55_REMI
-rwxrwx--- 1 root www 55 Feb 23  2015 php56_REMI
-rwxrwx--- 1 root www 55 Dec 11 10:56 php70_REMI
-rwxrwx--- 1 root www 55 Dec 11 10:56 php71_REMI
-rwxrwx--- 1 root www 55 Dec 11 10:56 php72_REMI
-rwxrwx--- 1 root www 55 Dec 11 10:56 php73_REMI

[root@sme92x64 ~]# php73 -v
PHP 7.3.0 (cli) (built: Dec  4 2018 18:26:59) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies

[root@sme92x64 ~]# php72 -v
PHP 7.2.13 (cli) (built: Dec  8 2018 10:49:37) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
--
qui scribit bis legit

Offline mmccarn

  • *
  • 2,626
  • +10/-0
Re: PHP-SCL - permissions and ownership for 7.2 and 7.3 in /usr/bin/phpscl
« Reply #10 on: December 11, 2018, 12:32:33 PM »
Needed the epel repo as well..

The epel requirement popped up for me on 12/6.

After installing smeserver-php-scl-0.4-20.el6.sme.noarch from smetest I was able to switch my wordpress ibay from PHP71 to PHP73 successfully.

I didn't do any timing tests, but it feels faster ;-)

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: PHP-SCL - permissions and ownership for 7.2 and 7.3 in /usr/bin/phpscl
« Reply #11 on: December 11, 2018, 01:45:15 PM »
Not sure about epel being required but I'll check
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: PHP-SCL - permissions and ownership for 7.2 and 7.3 in /usr/bin/phpscl
« Reply #12 on: December 11, 2018, 04:31:19 PM »
For whatever good reason if you are using smeserver-php-scl (which you probably should be) you need epel.

remi-safe is enabled by default, but epel is not.

So to install the basic contrib you need:

Code: [Select]
yum install smeserver-php-scl --enablerepo=smecontribs
But to install a version of PHP you need:

Code: [Select]
yum install smeserver-php-scl php56-php-pecl-rar php56-php-libvirt php56-php-magickwand --enablerepo=smecontribs,epel
(note that as remi-safe is enabled you don't need it with this command)
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: PHP-SCL - permissions and ownership for 7.2 and 7.3 in /usr/bin/phpscl
« Reply #13 on: December 11, 2018, 04:35:09 PM »

After installing smeserver-php-scl-0.4-20.el6.sme.noarch from smetest I was able to switch my wordpress ibay from PHP71 to PHP73 successfully.

I didn't do any timing tests, but it feels faster ;-)

Can you verify that it cures the issue as above and and comment on the bug? I can then push it out ?

Just need to check that the perms and ownership change in /usr/bin/phpscl
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: PHP-SCL - permissions and ownership for 7.2 and 7.3 in /usr/bin/phpscl
« Reply #14 on: December 12, 2018, 02:32:50 PM »
And released an update

https://bugs.contribs.org/show_bug.cgi?id=10662

smeserver-php-scl-0.4-20.el6.sme.noarch.rpm

Should be in the repos in a few hours
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation