Forums / Install & configuration / php safe mode and .htaccess

php safe mode and .htaccess

Author Message

paul bolger

Saturday 12 August 2006 11:17:43 pm

I'm trying to set up EzPublish on a remote Linux host. The host has PHP safe mode set to 'on', and I'm trying to override that with a line in .htaccess in the root directory.
My question is: How do I tell if the override is working? The installer, and phpinfo, are maintaining that safe mode is still on. Can I ignore that warning?

Paul Bolger

Łukasz Serwatka

Sunday 13 August 2006 11:20:00 pm

Hi Paul

safe_mode can be set in php.ini or httpd.conf. It will not work with .htaccess. This means that you need full access to your web server environment. You can ask also system administrator for help.

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

paul bolger

Monday 14 August 2006 5:32:43 am

Hi Lukasz

Ok, if I have to ask my hosting provider to turn of safe mode for my site, is there anything else I need to ask for at the same time?
I'm a bit unclear whether the other problems mentioned in the finetune dialogue (wrong permissions for a couple of directories under /var, and inability to create or write to /tmp) would still be issues if safe mode was switched off.

BTW: do you know which files need to be deleted or replaced to take EzPublish back to the beginning of the automated installation? I've got to a point where I have a non-functioning installation and it'd be nice be able to undo it without deleting the lot and re-starting.

regards
Paul Bolger

Paul Bolger

Łukasz Serwatka

Monday 14 August 2006 5:47:34 am

Hi again,

I'm a bit unclear whether the other problems mentioned in the finetune dialogue (wrong permissions for a couple of directories under /var, and inability to create or write to /tmp) would still be issues if safe mode was switched off.

Web server needs write permissions to the eZ publish var/ directory. It is directory where are stored images, cache files, logs, etc.

You will need also permissions to upload files (images, documents, etc) via HTTP. Disable safe_mode should help. Ask administrator about this.

BTW: do you know which files need to be deleted or replaced to take EzPublish back to the beginning of the automated installation? I've got to a point where I have a non-functioning installation and it'd be nice be able to undo it without deleting the lot and re-starting.

Remove all files from the settings/override/ also directories from settings/siteaccess/ which where created by you or your installation wizard (keep only admin and setup, that 2 comes with default distro).

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

paul bolger

Tuesday 15 August 2006 2:16:42 am

Hi Lukasz

I asked my hosting company to turn off safe mode for my domain, and they... added a line to the .htaccess file in the root directory. Can you explain why this doesn't work for EzPublish while it (apparently) does for other PHP apps?
I'm not trying to be smart, I just need to be able to justify myself if I go back to them with a special request.

Paul Bolger

Paul Bolger

Łukasz Serwatka

Tuesday 15 August 2006 2:22:28 am

Can you please provide link to the phpinfo and check what line was add to your .htaccess?

Create new file info.php with code inside:

<?php phpinfo(); ?>

Then run it in your web browser. Check safe_mode for local and global setting.

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

paul bolger

Tuesday 15 August 2006 4:46:32 pm

Hi Lukasz

I tried running php.info again and guess what: 'safe mode = off"

So it seems that adding php_admin_flag safe_mode Off (this is what the host helpdesk said they added) to .htaccess has fixed the problem, although I'm a little confused as to where it's been added as I can't see it in any of the directories visible to me.

Anyhow, to clarify for anyone else reading, .htaccess overriding of php safe mode will display in php.info - if it's showing as 'safe mode = on' you need to try something else.

Thanks for your patience.

Paul Bolger

Paul Bolger

Łukasz Serwatka

Tuesday 15 August 2006 11:11:41 pm

I think they set this flag in the httpd.conf. That setting can be only change in the php.ini or in httpd.conf. If user could disable safe_mode via .htaccess then whole idea of safe_mode obviously does not make sens.

More about safe_mode
http://no.php.net/manual/en/features.safe-mode.php#ini.sect.safe-mode

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

eZ debug

Timing: Jan 18 2025 00:02:10
Script start
Timing: Jan 18 2025 00:02:10
Module start 'content'
Timing: Jan 18 2025 00:02:11
Module end 'content'
Timing: Jan 18 2025 00:02:11
Script end

Main resources:

Total runtime1.4690 sec
Peak memory usage4,096.0000 KB
Database Queries209

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0082 587.8281180.8281
Module start 'content' 0.00821.3022 768.6563620.2031
Module end 'content' 1.31040.1584 1,388.8594345.0859
Script end 1.4689  1,733.9453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00440.3029210.0002
Check MTime0.00160.1096210.0001
Mysql Total
Database connection0.00130.085910.0013
Mysqli_queries1.360092.58042090.0065
Looping result0.00310.21132070.0000
Template Total1.429797.320.7148
Template load0.00200.139320.0010
Template processing1.427697.185220.7138
Template load and register function0.00010.008810.0001
states
state_id_array0.00070.047710.0007
state_identifier_array0.00130.086420.0006
Override
Cache load0.00180.1233510.0000
Sytem overhead
Fetch class attribute can translate value0.00190.132530.0006
Fetch class attribute name0.00160.1113100.0002
XML
Image XML parsing0.00160.109730.0005
class_abstraction
Instantiating content class attribute0.00000.0029160.0000
General
dbfile0.00520.3570350.0001
String conversion0.00000.000430.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
8content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
15content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 41
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs