Issue Details (XML | Word | Printable)

Key: MDL-18112
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Petr Skoda
Reporter: Martin Dougiamas
Votes: 0
Watchers: 4
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Too harsh: Sorry, Moodle requires PHP 5.2.8 or later (currently using version 5.2.6)

Created: 02/Feb/09 03:50 PM   Updated: 13/Nov/09 09:43 AM
Return to search
Component/s: Administration
Affects Version/s: 1.9
Fix Version/s: 2.0

Participants: Daniele Cordella, Eloy Lafuente (stronk7), Martin Dougiamas, Petr Skoda and Ralf Krause
Security Level: None
Resolved date: 03/Feb/09
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
Upgrading to latest HEAD today a lot of people got a single line:

   "Sorry, Moodle requires PHP 5.2.8 or later (currently using version 5.2.6)"

and nothing else. (Site is effectively stone dead).

This is far too harsh, since we all know Moodle install will actually run fine on lower versions. Can't we a be a bit nicer about this? :)

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Martin Dougiamas added a comment - 02/Feb/09 03:51 PM
I think the environment page which everyone sees on upgrade is perfectly fine as a way for admins to find out about this. If they choose to continue anyway then it's up to them.

Petr Skoda added a comment - 02/Feb/09 04:25 PM
You get file parsing error if PHP 4.x used.
Moodle installer will not work at all if PHP 5.1.x or lower used - we use PHP 5.2.x features in libraries.
Code will throw some ugly errors if PHP 5.2.0 used and probably will not work at all.

In PHP 5.2.6 the unzipping will fail mysteriously which would be very confusing imo - do we really want all those ppl discovering this dead end and reporting over and over again into tracker? My -10

If we allow versions < 5.2.8 to start the installer we will have to test all of them to make sure that they actually get to the environment page.
I propose to test for 5.2.4 early in admin/index.php + display a better/nicer error message pointing at docs page with explanation and doing proper 5.2.8 PHP version test in environment later

The same in installer - fail early if PHP < 5.2.4 and later test in environment for 5.2.8.


Petr Skoda added a comment - 02/Feb/09 04:44 PM
hmm, that reminds me the /install.php should be at least parsable by PHP 4 - all the PHP5isms should be hidden in lib/installib.php so that we may dispplay notice that we need PHP 5.2.8

Petr Skoda committed 1 file to 'Moodle CVS' - 03/Feb/09 04:59 AM
MDL-18112 making the php version error less harsh - now displayed only if php < 5.2.0, versions < 5.2.8 are detected during environment test
MODIFY admin/index.php   Rev. 1.373    (+6 -5 lines)
Petr Skoda added a comment - 03/Feb/09 05:00 AM
php version error less harsh - added hint that 1.9.x should be used instead if PHP upgrade not possible
now displayed only if php < 5.2.0
versions < 5.2.8 are detected during environment test

thanks for the report


Petr Skoda made changes - 03/Feb/09 05:00 AM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Daniele Cordella added a comment - 05/Feb/09 04:38 PM
Sorry but... I was stopped by moodle2 upgrade few days ago.
I went around reading and I found this issue telling that "now displayed only if php < 5.2.0 " so I went back to download the latest daily release but... I got a harsh "è necessaria la versione 5.2.8 e la vostra versione attuale è 5.2.5" (it is in IT but I am sure you understand it completely).
Am I missing something?
Is there a "How to" page to hack MAMP or XAMPP (for Mac) in order to upgrade php to 5.2.8?
Thanks in advance, Martin and Petr.

Martin Dougiamas added a comment - 06/Feb/09 12:12 PM
Sorry, Daniele - don't know.

Perhaps you could ask on http://www.mamp.info/en/mamp.html

We need to upgrade our Mac packages too. http://download.moodle.org/macosx/


Daniele Cordella added a comment - 06/Feb/09 03:35 PM
Ciao dear Martin
I already asked some months ago to add xmlrpc lib into "MAMP wish list" forum but they even didn't reply me. On the contrary, they replayed in few hours to Ralf Krause asking for the same request. Maybe it is better to ask him to post a request to MAMP people.
Ciao.

Ralf Krause added a comment - 09/Feb/09 04:48 PM
Hi all,

there are new releases for versions of Moodle4Mac but not for Moodle4Mac 2.0.

The problem is the missing PHP version 5.2.8 in MAMP 1.7.2. Daniele, I'm not sure that I get the things quicker then you. I waited for 3 months for the correct link to the sources for MAMP 1.7.2 to get a chance to compile the extension zip and xlmrpc. ..... and now we have to wait for the next MAMP release with PHP 5.2.8 and for the new sources.

I was looking for XAMP for Mac OS X. They will start with XAMPP for Mac OS X 1.0.0 very soon. They still have some problems with their package. I got the package. It comes with PHP 5.2.8 but I can't see where the real problems could be found.
http://www.apachefriends.org/download.php?xampp-macosx-1.0.0a.dmg
http://www.apachefriends.org/download.php?xampp-macosx-1.0.0a-dev.dmg

One of the problems is that you must know an administrator password to get XAMPP running on your Mac. This would be a bad condition for schools lessons or teachers workshops.

The second problem I found is that I can't compile the PHP extenison xmlrpc with 'pecl install xmlrpc' ... the zip extension works fine but not the xmlrpc extension ... and I can't find the reason. Perhaps someone else could help so we can try the new XAMPP for Mac OS X with Moodle 2.0

Best regards, Ralf


Daniele Cordella added a comment - 09/Feb/09 05:06 PM
Maybe I was posting my request few days before their answer to your post.

In any case,
thanks for your update Ralf,
by reading http://www.apachefriends.org/en/xampp-macosx.html I was sure XAMPP was in the same bad position with respect to php.
I don't see any simple solution to the problem.


Daniele Cordella added a comment - 09/Feb/09 07:34 PM
Petr, maybe it is needed the change of row 230 of environment.xml
from
admin/environment.xml: <PHP version="5.2.8" level="required">
to
admin/environment.xml: <PHP version="5.2.0" level="required">
in order to have
php version error displayed only if php < 5.2.0 ?
It is nothing more than a question, I really don't know!
but... I am still getting the complain about php 5.2.5 instead of 5.2.8

Petr Skoda added a comment - 09/Feb/09 07:44 PM
No, PHP 5.2.8 is still required! Early PHP 5.2.0 test is there only because the environment code will not work at all and would not show the nice env error.

Ralf Krause added a comment - 15/Feb/09 03:17 AM
Hi all,

I just finished two new packages

XAMPP 1.0.0a is still not finally released. It comes with everything we need for Moodle 2.0. The package works with Intel and PPC (Universial Binary) and should run wit Mac OS X 10.4 and 10.5. The extensions zip.so and xmlrpc.so must be tested.

Please have a look to both and test them as hard as you can. It should be very important for me to get an detailed report.

Best regards from Germany, Ralf


Ralf Krause added a comment - 15/Feb/09 03:21 AM
Sorry ... Moodle4Mac 2.0 dev (20090214) with XAMPP 1.0.0 will upload during the next 60 minutes. Please don't try to download before it's ready.

Ralf


Daniele Cordella added a comment - 15/Feb/09 03:46 PM
Thanks Ralph.
Starting the download now.

Daniele Cordella added a comment - 15/Feb/09 04:22 PM
XAMPP control says:
"MySQL can't start"

What am I missing?
Of course, I shut down apache2 and mySQL in MAMP before.


Ralf Krause added a comment - 15/Feb/09 06:27 PM
Which package does not start ... Moodle4Mac 1.9 or 2.0?

In 2.0 I found that you should delete the file XAMPP/etc/xampp/fix_rights ... sorry but I forgot it. While this file exists no correction of the file rights will be done ... and XAMPP works with the user nobody who can't read the file from Daniele. Please try.

Ralf


Ralf Krause added a comment - 15/Feb/09 06:59 PM
The next error is that the files from Moodle do not get the correct permissions. MySQL can't access. The same thing would be inside the folders /Applications/XAMPP/xamppfiles/htdocs but the web server can read the files .... and also /Applications/XAMPP/xamppfiles/data

sudo chown -R nobody /Applications/XAMPP/xamppfiles/var/mysql/moodle20
sudo chown -R nobody /Applications/XAMPP/xamppfiles/data/moodle20
sudo chown -R nobody /Applications/XAMPP/xamppfiles/htdocs/moodle20

Ralf


Ralf Krause added a comment - 15/Feb/09 07:10 PM
Yes, now it's working for me.

Another thing .... do you know why I can't see any picture on the front page or in any course when I 'm not logged in as the admin? The Moodle4Mac is open for guests to read everything without a login. Guest can read but guests do not get the pictures. The same thing happens with any new user.

Is this a mistake in Moodle4Mac or is this a "normal" bug in Moodle 2.0 dev at this moment?

Ralf


Daniele Cordella added a comment - 15/Feb/09 08:18 PM
> Which package does not start?
None of them. I didn't get them. I am still fighting with mysql and php.
I would like to run Moodle20.

Thanks Ralf.
By deleting XAMPP/etc/xampp/fix_rights my mySQL started.
I also executed the three commands (for free, trusting you still without any evidence of need):
sudo chown -R nobody /Applications/XAMPP/xamppfiles/var/mysql/moodle20
sudo chown -R nobody /Applications/XAMPP/xamppfiles/data/moodle20
sudo chown -R nobody /Applications/XAMPP/xamppfiles/htdocs/moodle20
but something still is not properly working.

but by visiting page http://localhost/moodle20
FF asks me to download the file index.php

I added file p.php with a call to phpinfo() function inside in /Applications/XAMPP/xamppfiles/htdocs/p.php but...
1) I am always requested for MAC system admin password. May this be a signal of a problem?
2) I am requested to download the file p.php

Help!!!
Where are setting about php in XAMPP?
Thanks in advance.


Ralf Krause added a comment - 16/Feb/09 12:00 AM
Hi Daniele,

I tried the packages myself on four different Apple computers.

After deleting fix_rights and setting the user nobody both packages worked properly for me. I could work with the local Moodles with Safari 3.2.1, Firefox 3.0.6, and Camino 1.6.6. There is no problem with the web server and the php pages.

Yes, you must enter the admin password because XAMPP switches the rights to root and to nobody. So every user must enter the admin password. Bad thing for schools if you want to work with a local Moodle4Mac in your workshop lessons. No school admin will really give the password to the students!

I asked Apache Friends if there is a way to change this fact but I got no answer. I know that everybody must enter the admin password if he wants to get a server running on a port less than 1024 ... so the web server of Moodle4Mac should run on a higher port such as 8000, 8008, 8080, or 8888.
http://www.apachefriends.org/f/viewtopic.php?f=29&t=33063

It's also bad to switch off the normal web server of a Mac computer. I have a Mac Pro at school with a lot of power. This Mac Pro works as an internal server. If I want to use the normal XAMPP package on this Mac Pro I have to switch of the normal web server ..... very bad!! Also for this fact it would be better to change the port to 8080.

Ralf


Ralf Krause added a comment - 16/Feb/09 12:06 AM
You will find the settings in XAMPP/etc ... the best place for settings.

Ralf Krause added a comment - 16/Feb/09 12:24 AM
If you want to switch the port of your web server from the normal port 80 to a different port 8080 you have to do a few things.

1. Open XAMPP/etc/httpd.conf. Find "Listen 80" and change it to "Listen 8080". Save the file and restart Apache.
2. Open XAMPP/xamppfiles/htdocs/moodle20/config.php and change http://localhost/moodle20 to http://localhost:8080/moodle20
3. Sorry, but you must edit all topics in your courses now. All links in Moodle are absolutly so you must change them from localhost to localhost:8080. You have to edit every locally referenced pictures and multimedia.

Ralf


Daniele Cordella added a comment - 16/Feb/09 04:23 AM
Thanks Ralf.
I really appreciate this.
If I find a solution to my problem I'll post the solution found.
Ciao and hank you again.

Ralf Krause added a comment - 16/Feb/09 08:00 AM
Hi all,

I build a new version of Moodle4Mac with Moodle 1.9 and 2.0 in one package with XAMPP 1.0.0.
You will get it from http://download.moodle.org/macosx/Moodle4Mac-xampp-20090215.dmg

I changed the port of the web server to 8080 because I want to have a local package for all users and not only for admins. During the next days I will look for the needed changes so every user of an iMac is allowed to start the software without knowing the admin password.

After the installation of the package on a Mac you still need to open the Terminal and to run the three following statements
sudo chown -R nobody /Applications/XAMPP/xamppfiles/var/mysql/moodle*
sudo chown -R nobody /Applications/XAMPP/xamppfiles/data/moodle*
sudo chown -R nobody /Applications/XAMPP/xamppfiles/htdocs/moodle*

XAMPP 1.0.0 should work on Intel and PPC with Mac OS X 10.4 and 10.5. After the insatllation you should start the server with the XAMPP Control panel. When the server is running then you will get your local Moodle pages in your browser. The admin account is already configured and two courses could be found in the Moodle.
http://localhost:8080/moodle19
http://localhost:8080/moodle20

Please write about everything you think. I hope to get the new Moodle4Mac very soon. ApacheFriends are still writing about some problems with XAMPP 1.0.0 so we need to wait until it finally will be published.

Best regards, Ralf


Ralf Krause added a comment - 16/Feb/09 08:31 AM
I forgot to delete XAMPP/etc/xampp/fix_rights again
.... so you have to do it yourself to get XAMPP running.

Martin Dougiamas added a comment - 10/Mar/09 10:14 PM
Ralf, if you want to just upgrade the MAMP packages with PHP 5.2.9, do this:

0) Have MAMP installed in /Applications/MAMP

1) Download PHP 5.2.9 from php.net and unpack it on your machine (anywhere).

2) In Terminal, go to directory and issue this command to configure PHP (cut and paste):

'./configure' '-with-mysql=/Applications/MAMP/Library' 'with-apxs2=/Applications/MAMP/Library/bin/apxs' 'with-gd' 'with-jpeg-dir=/Applications/MAMP/Library' 'with-png-dir=/Applications/MAMP/Library' 'with-zlib' 'with-freetype-dir=/Applications/MAMP/Library' 'prefix=/Applications/MAMP/bin/php5' 'exec-prefix=/Applications/MAMP/bin/php5' 'sysconfdir=/Applications/MAMP/conf/php5' 'with-config-file-path=/Applications/MAMP/conf/php5' 'enable-bcmath' 'enable-ftp' 'enable-gd-native-ttf' 'with-bz2=/usr' 'with-ldap' 'with-mysqli=/Applications/MAMP/Library/bin/mysql_config' 'with-sqlite' 'with-ttf' 'with-t1lib=/Applications/MAMP/Library' 'enable-mbstring=all' 'with-curl=/Applications/MAMP/Library' 'enable-sockets' 'enable-bcmath' 'with-imap=shared,/Applications/MAMP/Library/lib/imap-2006i' 'enable-soap' 'with-kerberos' 'enable-calendar' 'with-pgsql=shared,/Applications/MAMP/Library/pg' 'enable-dbase' 'enable-exif' 'with-libxml-dir=/Applications/MAMP/Library' 'with-gettext=shared,/Applications/MAMP/Library' 'with-xsl=/Applications/MAMP/Library' 'with-pdo-mysql=shared,/Applications/MAMP/Library' 'with-pdo-pgsql=shared,/Applications/MAMP/Library/pg' 'with-mcrypt=shared,/Applications/MAMP/Library' 'with-openssl' '-with-iconv-dir=/Applications/MAMP/Library'

3) Type "make" and watch PHP compile.

4) Type "make install" to install PHP within MAMP.

5) Restart MAMP! It should be working fine.

6) Build a new .dmg package for everyone!


Ralf Krause added a comment - 10/Mar/09 11:06 PM
Hi Martin,

using an updated MAMP would be the best choice because XAMPP needs an admin account to start on Mac OS X.

If you compile PHP in this way on your MacBook you will get a MAMP for Intel machines. MAMP 1.7.2 comes as an Universal Binary so I should compile PHP also as an Universal Binary. Or do you think we should use MAMP 1.7.1 to have one version for Intel processors and one version for PPC processors?

Ralf


Eloy Lafuente (stronk7) added a comment - 10/Mar/09 11:53 PM
Having something like this in the env:

CFLAGS = -arch ppc -arch i386 -mmacosx-version-min=10.4"

should help to build 32bit universals for 10.4 and 1.5 (note it also could be interesting to experiment with Intel 64bits -arch x86_64 )

But perhaps it's better to have them separated? (size of downloads and so on).

Anyway, these are the flags I've currently in my environment, where I compile everything (x86_64 only), in case they help:

MACOSX_DEPLOYMENT_TARGET=10.5
CFLAGS="-arch x86_64 -g -Os -pipe -no-cpp-precomp"
CCFLAGS="-arch x86_64 -g -Os -pipe"
CXXFLAGS="-arch x86_64 -g -Os -pipe"
LDFLAGS="-arch x86_64 -bind_at_load"
export CFLAGS CXXFLAGS LDFLAGS CCFLAGS MACOSX_DEPLOYMENT_TARGET


Martin Dougiamas added a comment - 10/Mar/09 11:57 PM
I think the HEAD version could just be Intel only... Would anybody who is a developer be using PPC machines still?

Ralf Krause added a comment - 14/Mar/09 12:10 AM
Hi Martin,

I just tried to do what you wrote ... no success. I got an error that Perl is not installed.

Ralf

_________
Here comes the compiler output with the error message

.....
Configuring SAPI modules
checking for AOLserver support... no
checking for Apache 1.x module support via DSO through APXS... no
checking for Apache 1.x module support... no
checking whether to enable Apache charset compatibility option... no
checking for Apache 2.0 filter-module support via DSO through APXS... no
checking for Apache 2.0 handler-module support via DSO through APXS...

Sorry, I cannot run apxs. Possible reasons follow:

1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)

The output of /Applications/MAMP/Library/bin/apxs follows:
cannot open /Applications/MAMP/Library/build/config_vars.mk: No such file or directory at /Applications/MAMP/Library/bin/apxs line 218.
configure: error: Aborting

macserver:php-5.2.9 ralf$


Ralf Krause added a comment - 14/Mar/09 03:29 AM
I got config_vars.mk from google but now I get a lot of other mistakes.

Perhaps I need to have the /Applications/MAMP/Library/include folder ... it does not come with MAMP and also not with the MAMP sources

Ralf


Ralf Krause added a comment - 14/Mar/09 06:00 PM
Martin, can you send me your MAMP 1.7.2 with PHP 5.2.9 please?

Martin Dougiamas added a comment - 14/Mar/09 09:41 PM
Hey Ralf! My working /Applications/MAMP folder is here: http://download.moodle.org/macosx/MAMP.zip (currently uploading, should be up in 30 min from now)

Ralf Krause added a comment - 16/Mar/09 12:46 AM
Hi Martin,
I downloaded the package and installed it on my iMac.

I had some problems but most of them could be resolved.

1. apache did not start
– the apache directory was /web from your machine
– I set it back to /Applications/MAMP/htdocs

2. apache was set to port 80
– I had to stopp my web sharing on the machine
– For starting the MAMP web server I must know the admin passwort
– I set it back to port 8888

3. double folders (this was not a problem for starting the server)
– /Applications/MAMP/bin/apache2/bin should be a link to ../../Library/bin
– /Applications/MAMP/bin/apache2/logs should be a link to ../../Library/logs

4. the additional php extension must be compiled for PHP 5.2.9
– the uploaded new version Moodle4Mac-20B does not work if the cache is set to "eAccelerator"
– open the MAMP settings
– set the zend optimizer "off" and start the apache
– try to set the zend optimizer "on" and set the cache to "xCache" ... then start the apache ... sometimes it works
– try to set the zend optimizer "on" and set the cache to "eAccelerator" ... then try to start the apache ... it should not start
– the error message follows
[15-Mar-2009 16:10:35] PHP Warning: [eAccelerator] This build of "eAccelerator" was compiled for PHP version 5.2.6. Rebuild it for your PHP version (5.2.9) or download precompiled binaries.
in Unknown on line 0
[15-Mar-2009 16:10:35] PHP Fatal error: Unable to start eAccelerator module in Unknown on line 0

5. I don't know if the other extensions work with PHP 5.2.9
– if there are extra conditions for eAccelerator there also could be some problems with the other php extensions (zip, xmlrpc, yaz, xcache, apc)

What should I do for these facts??
I will start the upload now .... the upload will need one hour from now on.

Best regards, Ralf


Ralf Krause added a comment - 16/Mar/09 12:54 AM
Correction for 4.

The Zend Optimizer could be "on" or "off".
Apache does not start when the cache set to "eAccelerator"


Ralf Krause added a comment - 16/Mar/09 02:25 AM
The upload is ready. You can download and try the package now.

http://download.moodle.org/macosx/Moodle4Mac-Intel-20B-20090315.dmg


Daniele Cordella added a comment - 16/Mar/09 07:31 PM
Sorry for a so silly question.
Are we sure that moodle.org is allowed to share a "hacked" release of MAMP without even change the name or asking for a permission to http://mamp.info? Mayebe moodle.org has to write somewhere that...
This is nothing more than a simple silly question!! I really don't know.

Daniele Cordella added a comment - 19/Mar/09 03:41 PM
Things are going to be always more difficult!
Yesterday I was asked to develop a very very simple module so I installed netbean 6.5.1 with xdebug following the instruction taken from: http://debuggable.com/posts/setting-up-xdebug-on-mac-os-x-or-win32-linux:480f4dd6-0240-4a90-8fa1-4e41cbdd56cb

Well, instructions apply only to last 1.7.2 release of MAMP so I upgraded from 1.7.1 to 1.7.2 but... the last release doesn't include xmlrpc and zip.

So now: MAMP 1.7.1 doesn't work with xdebug
The work of Ralf is still in progress
ana MAMP 1.7.2 doesn't work with Moodle2 even reducing the PHP requirement

May I ask to include in next MAMP release the support for xdebug... maybe hidden, by writing in docs.moodle.org which php.ini rows to un-comment in order to have it working?
Thanks in advance.


Ralf Krause added a comment - 24/Mar/09 04:03 AM
Hi all,

Martin and I met on the german MoodleMoot 2009 in Bamberg/Germany. Martin fixed the problems with PHP 5.2.9 and MAMP 1.7.1 so I could build a new package for Moodle4Mac 2.0 dev. Please have a look and try ... I hope it works fine.

Download the package Moodle4Mac 2.0 dev (Build: 20090320) from http://download.moodle.org

Best regards, Ralf

PS
Martin will build the same package for the PPC processor .... the current version only works with Intel processors but Helen also wants to get Moodle 2.0 on her MacBook Pro .... and she still has a PPC.


Daniele Cordella added a comment - 25/Mar/09 02:17 AM
it works fine for me.
Thanks Ralf and Martin.