disbale php

Discussion in 'General' started by Alborz, Jan 1, 2014.

  1. Alborz

    Alborz New Member

    Hi guys,
    Happy new year!

    How can I disable php in a vhost?
    I disable it with adding this line to httpd.conf:
    php_flag engine off
    but it can be overridden in .htaccess
    I am using cpanel and last enterprise lsws

    Thanks
  2. NiteWave

    NiteWave Administrator

    http://php.net/manual/en/configuration.changes.php
    " You will need "AllowOverride Options" or "AllowOverride All" privileges to do so."

    tested on a native virtual host,
    when set
    AllowOverride -Options

    and in vhost's reriterule,
    php_flag engine off

    then in .htaccess
    php_flag engine off
    or
    php_flag engine on

    not effective at all.
  3. Alborz

    Alborz New Member

    This is in my vhost:
    Code:
    UseCanonicalName Off
    AllowOverride -Options
    RemoveHandler cgi-script .cgi .pl .plx .ppl .perl
    php_flag engine off
    
    .htaccess still can set engine on

    Thanks
  4. NiteWave

    NiteWave Administrator

    did tests on apache virtual host. the result is a bit of different with yours.
    my result is:
    php_value engine on/off
    not work at all when put in .htaccess

    look at
    http://php.net/manual/en/configuration.changes.php
    again, should be
    php_admin_value engine on/off

    but php_admin_value not work in .htaccess
  5. Alborz

    Alborz New Member

    where is different come from?
  6. mistwang

    mistwang LiteSpeed Staff

    Please read more about the difference between "php_admin_value" and "php_value".

Share This Page