Forcing PHP version

Re: Forcing PHP version

by Matteo Scaramuccia -
Number of replies: 8
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Colin,
this is not a change in the code but in the environment hosting the code: tell us more about your stack.

For example, LAMP on CentOS 7: https://blog.remirepo.net/post/2016/02/14/Install-PHP-7-on-CentOS-RHEL-Fedora for PHP as module in Apache (simpler) and https://developers.redhat.com/blog/2017/10/25/php-configuration-tips/ for PHP-FPM (more flexible).

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: Forcing PHP version

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Hi Matteo, this is not that clearcut. I am using an NGnix based on a CentOS version, I believe. I have no idea what that means though, I can say it is a Synology NAS, with DSM v6.1.5-15254. And that is about it, I am afraid. I had only installed PHP v7.0x but then I had to include a phpMyAdmin for accessing the Maria10 DB, which demanded a v5.6 of PHP, so the Moodle uses the v5.6 rather than the v7.0.... mmmm  

EDIT: The NAS has a severely adulterated Linux OS, and most of the included packages in the official release of the OS, are not included as default, but rather additional extras... 

I will look at the links you have kindly provided, and will let you know. 

Thanks mate!...smile 

    

In reply to Colin Fraser

Re: Forcing PHP version

by Colin Fraser -
Picture of Documentation writers Picture of Testers

The links relate to the installation of the related OS and are very likely not going to be suited for the NAS environment. Seems it is easy to make a mess of the NAS trying to adapt it to a real world server... well, it isn't but it can emulate one. Thanks anyway Matteo... Cheers


In reply to Colin Fraser

Re: Forcing PHP version

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

These NAS boxes seem really popular all of a sudden...

It's definitely a function of your particular server/box and is nothing to do with Moodle. It's a bit out of date but a two-second Google turned up,

https://forum.synology.com/enu/viewtopic.php?t=77620

I'm sure you can narrow it down a bit. To be honest, you're probably much better off asking in the synology forums. Let us know how you get to tie it up though!

In reply to Howard Miller

Re: Forcing PHP version

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Hi Howard, yes, I had already found that post, but the DSM version seems quite important to the essential methodologies used to make it all work. Still working that out, Got the NAS for additional storage and because it has a builtin web server which means I could connect to it externally, easily and without any technical drama. My linux skills are just not up to building my own server, so I thought an out of box solution ideal for me. I suspect this is the real reason for its popularity, I have my Moodle on it, but that is not without its own hiccoughs, yet it is still very handy btw. Soon as I am confident enough and I can organize it with my ISP, I will be putting it all online, so who knows what will happen then.

  


In reply to Colin Fraser

Re: Forcing PHP version

by Ken Task -
Picture of Particularly helpful Moodlers

Check a couple of things, please ... as whatever user (root preferred) on the server:

uname -an

and

cat /etc/red[tabkey][enter]   we are looking for a text file 'release'.

Hard to imagine the folks who make the NAS would do kernel devleopment ... but they might.   Above might tell you more about the CentOS.

Know they have a web based package manager .... does that use PHP? ... but wonder if that cleverly hides what normally comes native to CentOS boxen ... yum.   Look for a /etc/ 'repos' directory of some kind.

You might be able to set up just one yum repo (webtatic) which focuses on PHP and MySQL AND be able to get the higher version of PHP installed.

Now if the web based package manager does use PHP, then it might be too risky!

Do agree wth Visvanath .... best, perhaps, to use something else for your sandbox Moodle.

'spirit of sharing', Ken


In reply to Ken Task

Re: Forcing PHP version

by Colin Fraser -
Picture of Documentation writers Picture of Testers

@Ken, the NAS is my private device, at home, and got it so I could use it as an out of the box web server. I saw one in operation and was impressed by the fact that not only did it work, it was accessible from work to the owner's home. Thought it would be ideal for what I wanted, and will be when set up properly. 

I am now admining a small Moodle, again, and they are currently on a v3.1.x and want to update to a v3.4.x about September/October, so are planning for it now. (These guys are so well organized, a pleasure to work with them.) Currently, they are using on their Linux/Apache/MariaDB/PHP stack PHP v5.6. 

While I am admining the Moodle for them, as they really wanted someone outside to let them know if something was not working, They could do it, but their idea is if they have me, or someone like me, I am going to let them know when they are getting it wrong, or they can be alerted to issues before they become major. Works for them, and I am happy they are quite prepared to put up with me. smile Works all round... 

I have access to the Moodle, the code base the Database, the moodledata directory, but that is all. That is not a problem because my Linux knowledge is, politely, limited (although learning lots lately). All this is set to a backdrop of me being a teacher, in a high school, with little time and few resources except for what I can make myself. 

While working on my Moodle a v 3.2.4, I looked at what PHP it was using, and found it was using a v5.6. I checked the production site and saw it too was using PHP v5.6. I know I have a v7.0 of PHP and looking at the specs for Moodle v3.4, saw that PHP v7.0 was recommended. I wasn't sure if my production site have PHP v7.0, they haven't yet but that is a planned upgrade too. My NAS Moodle is using PHP v5.6 despite having v7.0 on the system. 

php snapshot

Until I put phpMyAdmin on the NAS, I only had PHP v7.0, but phpMyAdmin doesn't use v7.0, only v5.6. 

I thought I could change where Moodle gets its PHP config file, within Moodle code, but apparently not. I can access the Apache httpd.config and the php.ini files on the NAS, but not on the production site server. I thought if there was a way to force Moodle to use a particular version of PHP, then I could pass that on to the server manager, solve a potential problem before it becomes a problem. I wouldn't just be relying upon the automaticity of Moodle to sort it for itself, that's all. 

But this is now way outside of Moodle's purview I suggest, and should be a dead topic. 

Thanks for the suggestions though, really appreciate the time you, Visvanath, Al and Howard have spent on it. 

Cheers...  

          

In reply to Colin Fraser

Re: Forcing PHP version

by Ken Task -
Picture of Particularly helpful Moodlers

Wow!  Really!   Thanks for the 'cheers', but .... 'dead topic'!!!????

NAS is one thing ... may not be able to do anything about it ... a NAS is a NAS and while it might be powerful, it's just not a good selection for a platform for Moodle ... given that moodle marches forward quickly and has been requiring higher versions, more resources, etc..

I am a former public school educator/coach of 20+ years ... with about 15 years at an Education Server Center in South Texas - Masters in Ed. Tech (recenly called 'Instructional Technology' - morphed into 'Information Tech' now.   I've seen tech from perspective of many sides.  When I retired was running core services for a wide area private network consisting of about 38 ISD networks.   I initially installed routers for first connects, then servers ... DNS (both internal/external), EMail gaetways, EMail servers, Web servers - static and dynamic (cms/lms [insert Moodles here]), etc. .... *** all of it on Linux *** all of it cost $0.00 - big deal for some schools whose technology budget for the year was $2500.00 - for everything!!!

Is the screen shot of the PHP on the school server or your NAS?   Think it's the NAS.  (Disk Station hint ... and the kernel is one of their own making.   So you might have to wait on the NAS for them to 'get around to it'.

What of the same screen shot on the moodle server that is being used by teachers and students?

It is somewhat easy to upgrade php to 7.0.x (if at Moodle 3.0.1+->highest and/or 7.1 (if at Moodle 3.4).

The only way that Al, Howard, or myself could help with that other server is to have some info ... no Vulcan Mind Melds possible with me ... can't speak for the other guys, however.

Pardon if this sounds 'pushy', I just don't take to walking away from a problem until I know I can't do something about it!    Well ... may have reached that point with you if you are calling it quits on this thread. :\

'spirit of sharing', Ken

In reply to Ken Task

Re: Forcing PHP version

by Colin Fraser -
Picture of Documentation writers Picture of Testers

NO, Ken..

Pardon if this sounds 'pushy', I just don't take to walking away from a problem until I know I can't do something about it! 

Doesn't sound pushy at all, determination is important, always. This is really not a Moodle issue, and the issue is really about using the NAS. It's not now, and never will be, a production site, but a repository for me that I can access and get additional materials that I may not put into a production site. As such, I really don't want to waste anyone's time with what is a) not a real Moodle problem, b) a personal whim, if you like, and c) something that is structured in such a way as to resist anything more than some tinkering at the edges. 

The NAS runs with its DiskStation Manager, and without the technical background required, I can't describe what it is I am seeing, or doing half the time..smile I am just as likely to wreck the whole thing if I push the wrong button, like using Putty to gain -su control and then edit a file only to have it be system critical. I've certainly done that before, several times...and ended up just about wearing out a set of 3.5inch floppy disks reinstalling MS-DOS ...smile (A while ago,,,but no-one told me what it was I should and shouldn't do,)