Forums / Install & configuration / Possible to run eZ with PHP safe_mode = On?

Possible to run eZ with PHP safe_mode = On?

Author Message

Felipe Jaramillo

Friday 08 December 2006 7:15:15 am

Hi,

I have a client who absolutely requires eZ to run on their servers, with some particular security policies.

Safe Mode = On
Safe Mode GID = On

PHP 4.3.x , Apache 2.0 on Solaris.

We would be using 3.6 becuase of the old PHP.

I've read there was a hack for this in the Contrib, but it seems to be outdated:
http://ez.no/community/contribs/hacks/living_with_safemode_and_gd

What are my options?

Thanks,

Felipe

Felipe Jaramillo
eZ Certified Extension Developer
http://www.aplyca.com | Bogotá, Colombia

Claudia Kosny

Friday 08 December 2006 1:02:18 pm

Hi Felipe

This depends on what the exact safe mode settings are on your server:
Have a look at the different safemode PHP settings:
http://lu.php.net/features.safe-mode

Some examples:
safe_mode_exec_dir can prohibit access to the imagemagick executable.
open_basedir can prohibit PHP to open a file in the tmp folder
disable_functions and disable_classes can disable core PHP functions and classes that EZ needs to work

All these settings can be set by your provider to his liking so it is impossible to say whether EZ will work or not. I would say that you can expect to have no access to imagemagick, which means you need gd. Access to all directories within the ezpublish tree should not be a problem. Access to a tmp directory might be a problem, but any halfway decent webhoster will give you such access as otherwise you cannot upload any files using a form.

I am not sure about the effects of the Safe Mode GID setting. There might be problems if you upload files using ftp (e.g the initial upload) making the ftpuser the owner, whereupon PHP can not open the files, but this depends again on the exact setup of your server.

Good luck

Claudia

Felipe Jaramillo

Wednesday 20 December 2006 2:59:02 pm

@Claudia,

Thank you for your answer.

Just to let you know, I have done some tests with your suggestion and managed to succesfully get eZ to work with safe_mode on an enviroment very close to the one I mentioned except on Linux instead of Solaris.

I will keep on trying to find areas of the system that cease to work with these restrictions.

If anyone is aware of any other pitfalls that may be caused by using safe_mode, I'd appreciate to let me know.

Regards,

Felipe

Felipe Jaramillo
eZ Certified Extension Developer
http://www.aplyca.com | Bogotá, Colombia

kracker (the)

Wednesday 20 December 2006 9:16:34 pm

I would be interested in helping collect any documentation of information on this subject.

- Steps to install eZ publish with PHP safe mode enabled
- Known issues, warnings and considerations
- Solutions and hacks per issue or consideration

//kracker

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

eZ debug

Timing: Jan 18 2025 05:12:17
Script start
Timing: Jan 18 2025 05:12:17
Module start 'content'
Timing: Jan 18 2025 05:12:17
Module end 'content'
Timing: Jan 18 2025 05:12:17
Script end

Main resources:

Total runtime0.1326 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0075 591.4844180.8047
Module start 'content' 0.00750.0063 772.289197.9609
Module end 'content' 0.01370.1188 870.2500526.6250
Script end 0.1325  1,396.8750 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00392.9646200.0002
Check MTime0.00151.1055200.0001
Mysql Total
Database connection0.00070.545510.0007
Mysqli_queries0.088466.68131410.0006
Looping result0.00110.82421390.0000
Template Total0.118189.110.1181
Template load0.00120.899410.0012
Template processing0.116988.199910.1169
Override
Cache load0.00090.645010.0009
Sytem overhead
Fetch class attribute can translate value0.00080.583910.0008
XML
Image XML parsing0.00020.184010.0002
General
dbfile0.00332.5025200.0002
String conversion0.00000.006130.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs