eZ publish 3.x on PHP 5

Author Message

Kristof Coomans

Tuesday 05 September 2006 3:57:19 am

Good news for the PHP5 fanatics!

I've managed to hack eZ's source code and finish the setup wizard on Apache2/PHP5.1.2 (zend 1 compatibility mode off) on Suse Linux 10.1.

More news on this soon... :-)

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Xavier Dutoit

Tuesday 05 September 2006 4:14:46 am

Well done !

On the 3.8 or 3.9 ?

X+

http://www.sydesy.com

Clemens T

Tuesday 05 September 2006 4:20:28 am

That's insane!! Excellent! Very interested in this :)

Alexandre Cunha

Tuesday 05 September 2006 4:28:34 am

I not familiar with PHP5.
Which the advantage to use php5 with ezpublish 3.x (probably pached) ?
There is any perfomance gain ?

http://AlexandreCunha.com

Paul Borgermans

Tuesday 05 September 2006 5:59:46 am

Hi

A bit on the rationale for doing this:

- first we don't agree thet ezpublish 4.0 should imply the use of the PHP4 series, I personally think it is a bad decision given the timeframe of ezp "Telemark" and the adoption of PHP5/6
- we also want to optimise our "sysadmin" duties, like install the latest distro from SuSE and not have to compile in our own php so we can rely on security patches from Yast (almost automatic updates) ... something required for higher end Enterprise class installations and organisations/companies with little resources (like us)
- better OO features for our own extensions
- possibly integrate a few components from ez components
- easier handling of our Lucene based search plugin(s) (being closer to Java in OO features helps too)
- in general for Java libraries used as backend in the future: the PHP-Java bridge will no longer require a non-standard PHP module for versions > PHP5.1

The first step is having a working ezp3.8.3 installation (apart from lots of STRICT warnings from the Zend engine this is already accomplished, :-))))) )
Next is to get rid of all strict warnings and solve more ez publish bugs which surface only now.

... and a side note: you should have seen the smile on Kristof's face entering my office and announcing it already works after 5-6 hours work (he started this in his free time)! I should also mention <i>sed</i> was/is of great help: semi-automated code changes

Now, what to do from here:
- we could create a fork and have a community driven PHP5 version of ez publish if we find enough <b>skilled</b> people to work together on this,
- stop here, as initially it was just an experiment, continue with PHP4
- stop here, if ez systems wakes up with the knowledge that porting to PHP5 may be doable after all?

Comments welcome, I'm sure many will follow ;-)

--paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Kristof Coomans

Tuesday 05 September 2006 6:40:20 am

It is based on the 3.8 code but merging changes into it should be not too difficult.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Paul Forsyth

Tuesday 05 September 2006 6:47:27 am

Well done Kristof!

Does it fail in anything major? Workflows, extensions, overriding?

I assume eZ would have done this sometime ago if its just a few hours work.

Perhaps get pubsvn.ez.no using it? :)

Paul

Kristof Coomans

Tuesday 05 September 2006 7:02:57 am

Does it fail in anything major? Workflows, extensions, overriding?

I did not test it completely, but I think if something fails it will be not too hard to fix with the base I have now.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Ronny Vedå

Tuesday 05 September 2006 9:02:23 am

Good job Kristof.

A php5 compatible eZ publish would definitely make server administration simpler. I guess most of us have other things to do than compiling php4.4 releases.

The big question now is: Will eZ systems reconsider making a php5 port? Anny comments from eZ systems?

Vidar Langseid

Wednesday 06 September 2006 2:57:36 am

yes, very good job Kristof

eZ and me personally welcome you iniative to port eZ publish to PHP5

But if you have used just 5-6 hours so far, I am pretty sure you have to spend a lot more before all the work is done. The code coverage (of eZ publish) run by the setupwizard is pretty small but you are one step on the way. We expect there are lot of issues to resolve. The objectmodel in PHP 4 and PHP 5 are different so parts of eZ publish will need to be rewritten.

eZ systems will not at this time reconsider to make a php5 port, but we will follow this with great interest. If a community project could address most of the issues that needs to be dealth with, that would be of great help to us. If this projects concludes with that a port is fashionable we would consider a port once again.

So we encourage you to continue this and are very glad to see such initiatives from the community. If we see that this project is successful we will look into how we can coordinate this with the official eZ publish development and make an official PHP 5 version of eZ publish 3.x.

Best regards,
Vidar L

zurgutt -

Wednesday 06 September 2006 5:43:50 am

Great news Kristof!

Even if it is not supported by eZ it will open up possibilities for those folks who for one reason or other can only consider php4.

Questions about if ezp runs on php5 are very frequent on #eZpublish channel (irc.freenode.net). Although my advice has been (and will be) to downgrade/find another hosting so far, this will open up another, although unsupported solution now.

I think best way to distribute it would be by patch to official version, plus porting instructions and scripts and big warning. This will encourage only those people to try it who know how to patch and avoid getting lots of newbie help requests on unsupported code.

Certified eZ developer looking for projects.
zurgutt at gg.ee

Kristof Coomans

Wednesday 06 September 2006 7:13:54 am

Feel free to try the current version I have (started with eZ 3.8.3, merged changes from 3.8.4 with 7 conflicted files), download available from http://users.telenet.be/coomans/ezpublish_384_php5.tar.gz

I left away the translation files since they take too much disk space:
- make sure you choose English - United Kingdom as your primary language in the setup wizard
or
- add those translation files from the official eZ publish release

Let's discuss how to proceed this as a community project. I'll write an article at my blog with coding tips & tricks as soon as possible.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Tony Wood

Wednesday 06 September 2006 7:16:16 am

Nice work Kristof .

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Samuel Sauder

Thursday 07 September 2006 8:11:48 am

Kristof, I'm really interested in this project and would be willing to do some testing. Your package from Sept 6 seems to be missing the index.php. I even tried bringing 3.8.3 files in and still get the errors described here
http://ez.no/community/forum/install_configuration/warning_array_merge_function_array_merge_argument_1

Did I miss something?
If I modify line 821 to typecast it to an array, I fix one problem but still get the module setup not found.

$instance->AccessPath = array_merge( (array)$instance->AccessPath, $path );

Kristof Coomans

Thursday 07 September 2006 9:15:48 am

Hello Samuel

Are you really sure about the missing index.php file? I've downloaded my own package, unpacked and found index.php where it belongs to be :-)

Fixed some important bugs today, will make it available from a subversion repository tomorrow.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Kristof Coomans

Friday 08 September 2006 1:12:19 am

I've updated the home page on pubsvn ( http://pubsvn.ez.no/ ). There are links now to the repository for the PHP5 community version.

Before uploading the current version, I'd like to discuss the repository layout. I'd suggest this structure:

stable
- 3.8
- ...

releases
- 3.8.x
- 3.8.y
- ...

To keep up to date with the eZ versions, there are two possibilities:

<b>the easy way</b>
Warning: this won't sound easy if you are not familiar with subversion :-)

In the repository, we also have this under the root:

original
- 3.8
- 3.9
- ...

stable/3.8 will be a svn copy of original/3.8 patched with the modifications for PHP5.

When there's a new maintenance release (3.8.x to 3.8.y) then we copy it over original/3.8 and commit it. Afterwards we merge the changes from original/3.8 to stable/3.8.

When there's a new version (3.x to 3.y), we svn copy original/3.x to original/3.y. Copy the new version over original/3.y and commit it. We also svn copy stable/3.x to stable/3.y and merge the changes between original/3.x and original/3.y to stable/3.y.

<b>the other way</b>
We can also check each commit on the nextgen repository and manually modify our PHP5 version. But I don't want to spend my time on this. Anyone will?

Tell me what you think :-)

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Michael Maclean

Monday 18 September 2006 5:30:57 am

I tried to get the setup wizard to run, but it fell over at the last step - I'll dig out the error and post it later if you're interested, it's on my laptop which I don't have handy. However, I copied over the design, settings and var directory from another (admittedly basic) site and it ran fine under PHP 5.1.2 and Apache 2.0 on Ubuntu 6.06 on AMD64. It was quite slow but I think that's due to the lack of RAM in this machine more than anything else. I'll keep poking at it and see if I can help out anywhere.

eZpedia community documentation project | http://ezpedia.org

Kristof Coomans

Monday 18 September 2006 7:35:14 am

@Michael

Can you provide me the installation details: which db are you using, which site package did you try to install, the error message you got?

Thanks!

@everyone:
No comments on the repository layout? I'll wait until tomorrow to check in the code.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Michael Maclean

Monday 18 September 2006 8:10:47 am

I'm using MySQL 5.0. As I recall it died while writing out the siteaccess settings - there's a line involving a rather strange-looking (to me) cast somewhere, but I can't remember offhand where. I was installing the "corporate" site package. I'll dig out the exact problem later tonight and post it once I get back to my laptop.

I've done a bit of playing with the install I did earlier without the setup wizard - you really need to have the default timezone set in php.ini or else you get several thousand errors related to the use of strftime on line 849 of lib/ezutils/classes/ezdebug.php:

It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/London' for 'BST/1.0/DST' instead in /var/www/ezphp5/lib/eztemplate/classes/eztemplatecompiler.php on line 516

Also, there are many errors complaining about permission problems when trying to open cache files in var/ for writing, however the permissions on the filesystem appear to be correct. I'll play about with that a bit further and see if I can narrow it down.

eZpedia community documentation project | http://ezpedia.org

Łukasz Serwatka

Monday 18 September 2006 11:54:42 pm

It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/London' for 'BST/1.0/DST' instead in /var/www/ezphp5/lib/eztemplate/classes/eztemplatecompiler.php on line 516

@Michael, you can solve this problem by adding date.timezone=Europe/London in your php.ini. Remember restart apache.

@Kristof, I did a test of eZ publish from your package. Some functionality does not work yet, for example it is impossible to remove drafts or content, discarding drafts causes fatal error on my setup ( SUSE Linux 10.1, Apache 2.2.0/PHP 5.1.2 (mod_php), error_reporting=E_STRICT ), lots of errors about mktime(), also references and static methods, character conversion does not work (Error: Failed to store transformation table ), cache is not cleared after publish (INI settings are correct). But installation was fast and without any problems.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.