PDA

View Full Version : .htaccess: Invalid command 'php_value',



ranmanh
06-21-2009, 06:05 AM
Hi,

checking the error logs I get something like the following



/home/xxxxxxx/public_html/xxxxx/egroupw/.htaccess: Invalid command 'php_value',

And the .htaccess is as follows:


#
# Set
#
# AllowOverride FileInfo
#
# to enable parsing off this file
#


AddType x-mapp-php5 .php .html .htm
AddHandler x-mapp-php5 .php .html .htm



RewriteEngine ON


php_value memory_limit 32M
php_value max_execution_time 60
php_flag register_globals Off
php_flag magic_quotes_gpc Off
php_flag magic_quotes_runtime Off
# settings for the file upload, you might increase them further
php_value upload_max_filesize 16M
# session handling: now the check for expired sessions is done on every 10th session creation
php_flag session.use_trans_sid Off
php_value session.gc_probability 1
php_value session.gc_divisor 10
# multibyte extension: needed for utf-8
php_value mbstring.func_overload 7

<Location "/home/xxxxx/public_html/xxxx/xxxx/icalsrv.php">
Script PUT /home/xxxx/public_html/xxxx/egroupw/icalsrv.php
AddHandler ical/ics .ics
Action ical/ics /home/xxxxx/public_html/xxxx/xxxx/icalsrv.php
AcceptPathInfo On
Order allow,deny
Allow from all
</Location>

For some reason the .httppaccess file fails to read the php definitions.

Also the apachehandlers in the cpanel menu are as follow:

User Defined Apache Handlers application/x-httpd-php .php

What I guess it should be correct. (it not, please, let me know because this might be the issue/or just another)

This is when installing egroupware as some of you might guessed.

Any idea?

I am walking in circles for the last couple of hours and I need some fresh overview from the outside

Thanks very much

Ran

pghcollectibles
06-21-2009, 07:06 AM
its possible that has to be placed in the php.ini file without the prefixes. for example, this is a piece of my php.ini

; Magic quotes
;

; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = On

; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
magic_quotes_runtime = Off

; Use Sybase-style magic quotes (escape ' with '' instead of \').
magic_quotes_sybase = Off

; Automatically add files before or after any PHP document.
auto_prepend_file = "/home/username/public_html/folder/prepend.php"
auto_append_file =
i tried to put php_value auto_prepend_file into my .htaccess file but it didnt work i found the php.ini solution.

if you dont know how to do it, go to your cpanel, in the software/services section, click PHP config. in that screen select single file, have it generate one for you. there are other instructions if you have a couple things installed and save the single file selection. it will add a line to your htaccess files about phpsingle. then edit the php.ini file changing what you need and adding the rest.

having magic quotes off does open up potential security risks for injections. if you have other scripts besides egroupware, you should watch out for incapatability issues

ranmanh
06-21-2009, 08:27 AM
Well... that's it.

Applications like egroupware are not built to install them on external hostings but intranet or your own boxes with full access to the apache server.
Some of the features will not totally work, like the ical service with read/write access which should be defined within the vhost file of apache for each domain/subdomain.
Also, as you mentioned, we have to setup independent configurations of the php.ini file rather than including the whole code within the vhost file in apache.

I removed all the code, modified the php.ini and that was it.
the .httaccess file does not understand about php variables/definition, neither tags like <Location> which are exclusive for the httpd.conf and the vhost files for apache.
I cannot think other work around than forgetting the ical synchronization capability of egroupware, which it is a pity.

Thanks very much

Ran