Imagemagick

Author Message

John Doe

Thursday 19 April 2007 6:13:39 pm

Hello!

My host is not running in php safe mode but also does not allow system() calls thus Imagemagick is not working. The system() call is yet allowed to run in php-fastcgi mode which you can set up by using AddHandler or the ending .phpx.

Is there any workaround to use IM with this environment like only letting the image handlers run in this mode? Let's say, is it possible to have the /lib/ezimage/classes/ directory parsed by AddHandler php-fastcgi or is it possible to rename the ezimageshellhandler.php to .phpx?

Please, i really do appreciate any help on this!

Egil Fujikawa Nes

Friday 20 April 2007 3:31:38 am

Hi John,

I been dealing with eZ publish hosting for many years, but this is a new and very interesting issue.
First of all I expect you have a good reason for using ImageMagic and not GD (that's not so hard to find).

As you write the php-fast-cgi module is activated with an AddHandler filter for the extension .phpx. This means that it's Apache that decide if it's the regular php integration or the php-fast-cgi module that should be used.

eZ publish in the other hand let all the request go trough index.php so simply change the extension of the file thats been included to us ImageMagic will not help.

What you can try to do is to change the name of index.php to index.phpx and then run all your eZ requests trough the php-fast-cgi module, I'm not sure if this will work but it's the only workaround I can see that not require a significant code job.

I would very much like to hear if this works out for you.

Good luck :)

Try out Free eZ Publish 4.0 Trial Hosting for 14 days:
http://webdealhosting.com/ez-publish-trial-hosting

High quality eZ Publish Hosting since 2001!

John Doe

Friday 20 April 2007 6:04:46 am

Hi Egil,

thanks for your reply!

I tried renaming index.php to extension .phpx. Debug output told me about problems with var/log so I 777 this directory with whole subcontent like the log files. No more bad debug output. But if I try the URL for the admin panel, it falls back to normal site, so there has to be an error depending the URL then.

After a grep of the source files, a reference to "index.php" is found in many of them so just renaming to .phpx would not do it, there always would be those little errors. So I set up an .htaccess with the content "AddHandler php-fastcgi .php". Now the index.php is handled over fastcgi without renaming.

I tried that these days already but there was always some error like the admin panel fell back again or there were no writing rights to the log directory.

It seems that in fcgi mode you have to change the rights in var/log as mentioned above. And to use the admin panel u should know that there is an "?" assigned to the index.php as far as I can see now (late :P), so to reach the admin panel you need to do a .../index.php<b>?</b>/your_admin_url. Then again, having made it to the admin panel, i cleared all the caches one after the other. Clicking on the "Clear" button in quick tab to the right just went to asking me if I wanted to download the index.php. Clearing cache after cache or all caches over the Design tab instead was working.

Loading the a page with images the first time gives a warning "chmod() ... Operation not permitted in ... ezimagehandler.php" and an error "Error: eZImageHandler::changeFilePermissions" ""Chmod 0666 (someimagefile) failed". Loading it a second time, those warnings and errors are gone. I looked up the named files by FTP and saw that they automatically were chmod 666 so maybe this is the reason why debug output did not show warnings and errors a second time alias when they are already cached.

To sum it up: AddHandler php-fastcgi in .htaccess, var/log and subcontent rights to 777, admin panel over index.php? (question mark!), weired index.php download if clicked on the wrong cache button, after clearing all caches a one time chmod() error.

I will have a try if I can live with this kinda not so really satisfying solution. ;)

Thanks again Egil for the information that all subscripts are running over index.php. That made me save some time on thoughts about how to change the other scripts.

Have a nice day!
the one who invested many many many hours in problems who shall not be there

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

eZ debug

Timing: Jan 18 2025 15:56:05
Script start
Timing: Jan 18 2025 15:56:05
Module start 'layout'
Timing: Jan 18 2025 15:56:05
Module start 'content'
Timing: Jan 18 2025 15:56:06
Module end 'content'
Timing: Jan 18 2025 15:56:06
Script end

Main resources:

Total runtime0.7662 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 587.9063152.6250
Module start 'layout' 0.00500.0027 740.531339.4453
Module start 'content' 0.00770.7567 779.9766541.4609
Module end 'content' 0.76450.0017 1,321.437512.1797
Script end 0.7661  1,333.6172 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4390160.0002
Check MTime0.00150.1944160.0001
Mysql Total
Database connection0.00070.093710.0007
Mysqli_queries0.709592.5991570.0124
Looping result0.00050.0709550.0000
Template Total0.737096.220.3685
Template load0.00250.321220.0012
Template processing0.734595.866220.3673
Template load and register function0.00020.024910.0002
states
state_id_array0.00120.161610.0012
state_identifier_array0.00110.146620.0006
Override
Cache load0.00200.2624300.0001
Sytem overhead
Fetch class attribute can translate value0.00060.072220.0003
Fetch class attribute name0.00150.190340.0004
XML
Image XML parsing0.00060.080020.0003
class_abstraction
Instantiating content class attribute0.00000.001540.0000
General
dbfile0.00190.2540150.0001
String conversion0.00000.001240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs