Results 1 to 15 of 15

Thread: php_flag engine

  1. #1

    php_flag engine

    Hello,

    I would like to disable php interpreter for one specific directory.

    Ive read php documentation and there they say its possible setting up a .htaccess file including the following syntax:

    php_flag engine off

    I have added it to a directory and everything that I get is Internal Server Error

    The error_log says:

    ... Invalid command 'php_flag', perhaps mis-spelled or defined by a module not included in the server configuration

    I am wondering if this error is happening because I am using phpsuexec instead of mod_php ?

    Thank you.
    Dedicated Servers, Managed OpenStack Cloud, Colocation and Managed Colocation in Brazil
    Privately owned 10,000 server capacity Data Center
    maxihost.com.br/en
    +1-844-243-9907

  2. #2
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    464

    Re: php_flag engine

    Originally posted by maxihost
    I am wondering if this error is happening because I am using phpsuexec instead of mod_php ?
    You need to use php.ini instead for phpsuexec servers.
    Net Logistics Web Hosting - Solutions Through Innovation

  3. #3
    I have trouble with pgpsuexec, they usually dont work for me, I like .ini, its easier to use, and is more compatible

  4. #4
    So there is no way to use that line using phpsuexec ?
    Dedicated Servers, Managed OpenStack Cloud, Colocation and Managed Colocation in Brazil
    Privately owned 10,000 server capacity Data Center
    maxihost.com.br/en
    +1-844-243-9907

  5. #5
    Join Date
    Jun 2003
    Location
    United States of America
    Posts
    1,838
    im no brainiack when it comes to this stuff but there could be indivdual settings in the php.ini file for each virtual host
    Computer Steroids - Full service website development solutions since 2001.
    (612)234-2768 - Locally owned and operated in the Minneapolis, Minnesota area.

  6. #6
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    464
    Create a php.ini file in /home/user/public_html/ and set the setting you want through that.
    Net Logistics Web Hosting - Solutions Through Innovation

  7. #7
    I created a file inside public_html directory called php.ini and set it with:

    Options FollowSymLinks
    php_flag engine off
    php_flag magic_quotes_gpc on
    php_flag register_globals on

    Nothing happened at all

    Any idea ?
    Dedicated Servers, Managed OpenStack Cloud, Colocation and Managed Colocation in Brazil
    Privately owned 10,000 server capacity Data Center
    maxihost.com.br/en
    +1-844-243-9907

  8. #8
    Any update ?
    Dedicated Servers, Managed OpenStack Cloud, Colocation and Managed Colocation in Brazil
    Privately owned 10,000 server capacity Data Center
    maxihost.com.br/en
    +1-844-243-9907

  9. #9
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    464
    You don't use php_flag in a php.ini, treat it like a normal php.ini file, but put only the directives you want to change.
    Net Logistics Web Hosting - Solutions Through Innovation

  10. #10
    Thank you, but how can I set inside php.ini to disable the PHP for that specific directory ?
    Dedicated Servers, Managed OpenStack Cloud, Colocation and Managed Colocation in Brazil
    Privately owned 10,000 server capacity Data Center
    maxihost.com.br/en
    +1-844-243-9907

  11. #11
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    464
    Just do it through Apache httpd.conf so that the user cannot over-ride it.

    Code:
    <Directory "/home/user/public_html/directory">
              php_flag engine off
    </Directory>
    Edit: Not sure if this will work for phpsuexec. I'm not sure if you can engine off for a specific directory with php.ini.
    Net Logistics Web Hosting - Solutions Through Innovation

  12. #12
    Thank you very much.
    Dedicated Servers, Managed OpenStack Cloud, Colocation and Managed Colocation in Brazil
    Privately owned 10,000 server capacity Data Center
    maxihost.com.br/en
    +1-844-243-9907

  13. #13
    Originally posted by Karthick
    Just do it through Apache httpd.conf so that the user cannot over-ride it.

    Code:
    <Directory "/home/user/public_html/directory">
              php_flag engine off
    </Directory>
    Edit: Not sure if this will work for phpsuexec. I'm not sure if you can engine off for a specific directory with php.ini.
    I tried this but I got the same error :/


    Syntax error on line 10342 of /usr/local/apache/conf/httpd.conf:
    Invalid command 'php_flag', perhaps mis-spelled or defined by a module not inclu ded in the server configuration


    Thank you.
    Dedicated Servers, Managed OpenStack Cloud, Colocation and Managed Colocation in Brazil
    Privately owned 10,000 server capacity Data Center
    maxihost.com.br/en
    +1-844-243-9907

  14. #14
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    464
    Yeah, you can't use php_flag in suexec. You need to find the php.ini directive for switching off the engine.
    Net Logistics Web Hosting - Solutions Through Innovation

  15. #15
    Anyone know the directive Karthick just mentioned ?

    Thanks.
    Dedicated Servers, Managed OpenStack Cloud, Colocation and Managed Colocation in Brazil
    Privately owned 10,000 server capacity Data Center
    maxihost.com.br/en
    +1-844-243-9907

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •