Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jun 2005
    Posts
    3

    Default Advice on php_flag AddHandler and Action

    I'm having some config issues with a new web host. Web Host version info at the end of the post...

    I have settings in my .htaccess to turn on compression in php, I then setup a handler to compress standard .txt .htm .html files.

    # turn on PHP compression
    php_flag zlib.output_compression on
    php_value zlib.output_compression_level 1
    php_value zlib.output_handler ob_gzhandler

    # turn on compress for text based files
    AddHandler compress .html
    AddHandler compress .htm
    AddHandler compress .txt
    Action compress /compress/compress.php

    Firstly, the php_flag generates an error in the error log, and tries to show a 500 page.

    [Mon Jun 27 14:54:48 2005] [alert] [client 62.49.188.139] /home/icemark/public_html/.htaccess: Invalid command 'php_flag', perhaps mis-spelled or defined by a module not included in the server configuration

    Reading up on this suggests that my host does not have AllowOverride option set to allow me to do this, but they have told me that it is set to 'ALL'.

    Secondly, if I remove the php_value commands, then the .htaccess works. THe handlers get set up, at least I can see them in CPanel as if I'd added them there, however, the Action command appears not to work.

    My webhost does not appear to know what the problem is and have suggested that it is something to do with CPanel or PHP - any help on this would be massively appreciated.

    One interesting aside; the CPanel does not show the same PHP version that php_info() does. Cpanel shows 4.3.11 but php_info show 5.04 which is the version that my host tells me is installed.

    **** Version Info *****


    Apache version 1.3.33 (Unix)
    MySQL version 4.1.11-standard
    PHP version 5.04
    PERL version 5.8.4
    Kernel version 2.4.21-32.0.1.ELsmp
    cPanel version 10.2.0-RELEASE-82
    cPanel Pro Version 1.0 (RC2)

    php info:
    Configure Command './configure' '--prefix=/usr' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-gettext' '--with-imap' '--with-imap-ssl' '--with-kerberos' '--with-mcrypt' '--enable-magic-quotes' '--with-mysql' '--enable-discard-path' '--with-pear' '--with-pspell' '--enable-sockets' '--enable-track-vars' '--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--enable-versioning' '--with-xmlrpc' '--with-zlib'
    Server API CGI
    Virtual Directory Support disabled
    PHP API 20031224
    PHP Extension 20041030
    Zend Extension 220040412
    Debug Build no
    Thread Safety disabled
    IPv6 Support enabled
    Registered PHP Streams php, file, http, ftp, compress.zlib
    Registered Stream Socket Transports tcp, udp, unix

  2. #2
    Member dave9000's Avatar
    Join Date
    Apr 2003
    Location
    arkansas
    Posts
    891
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    put the php directivies inside of a php.ini in the /home/username folder

    It sounds like they have phpsuexec installed and you can not use php directivies inside of the .htaccess file
    Dave Browning
    Intersite Technologies
    Greenbrier Ar
    dave@isitetech.com

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    3

    Default

    Quote Originally Posted by dave9000
    put the php directivies inside of a php.ini in the /home/username folder

    It sounds like they have phpsuexec installed and you can not use php directivies inside of the .htaccess file
    Thanks. you are correct about the phpsuexec, they told me about that later today.

    I tried the php.ini with no joy... the Action command is not working ( the resultant compress.php should just outputs "Hello" instead of the page ) but the page is being loaded as normal. And php output is not getting compressed.

    I put the php.ini in my lowest level directory and in my public_html directory, but to no affect. Could php.ini processing be turned off, or is there any way of being sure it is being processed?

  4. #4
    Member dave9000's Avatar
    Join Date
    Apr 2003
    Location
    arkansas
    Posts
    891
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    make a page with just <? phpinfo() ?> on it and then view it through the web browser and see if php is picking up any of the directivies inside the php.ini

    also paste your php.ini that your putting in the directory
    Dave Browning
    Intersite Technologies
    Greenbrier Ar
    dave@isitetech.com

  5. #5
    Registered User
    Join Date
    Jun 2005
    Posts
    3

    Default

    Quote Originally Posted by dave9000
    make a page with just <? phpinfo() ?> on it and then view it through the web browser and see if php is picking up any of the directivies inside the php.ini

    also paste your php.ini that your putting in the directory
    Nothing is being picked up.

    Here is my php.ini - I just moved my stuff across from the htaccess, because that's all I read to do from other places.


    # turn on PHP compression
    php_flag zlib.output_compression on
    php_value zlib.output_compression_level 1
    php_value zlib.output_handler ob_gzhandler

    # turn on compress for text based files
    AddHandler compress .html
    AddHandler compress .htm
    AddHandler compress .txt
    Action compress /compress/compress.php

  6. #6
    Member dave9000's Avatar
    Join Date
    Apr 2003
    Location
    arkansas
    Posts
    891
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    http://us2.php.net/zlib .

    here is a url that explains the syntax to add those commands to a php.ini

    as in
    zlib.output_compression = On
    Dave Browning
    Intersite Technologies
    Greenbrier Ar
    dave@isitetech.com

Similar Threads & Tags
Similar threads

  1. Configure PHP and SuExec PHP5/4 addhandler issue
    By devGOD in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 03-10-2011, 03:47 PM
  2. where is the AddHandler option in WHM?
    By SoftDux in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 02-19-2010, 02:46 AM
  3. .htaccess php_flag command fail
    By surapong in forum New User Questions
    Replies: 6
    Last Post: 08-19-2009, 12:12 AM
  4. easyapache3 removing AddHandler from .htaccess
    By s_rage in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 12-13-2008, 12:54 AM
  5. MIMETypes/AddHandler Apache2, suPHP and PHP5
    By WireNine in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 01-03-2008, 01:13 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube