Php files not working after enabling fastcgi, suexec

Discussion in 'HOWTO-Related Questions' started by Ramya_2015, Mar 9, 2015.

  1. Ramya_2015

    Ramya_2015 New Member

    I am getting below error after enabling fastcgi,suexec any idea whats wrong am i doing here?
    curl http://localhost/phpinfo.php
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>403 Forbidden</title>
    </head><body>
    <h1>Forbidden</h1>
    <p>You don't have permission to access /phpinfo.php
    on this server.</p>
    My configuration:
    Suexce configuration:
    ./suexec -V
    -D AP_DOC_ROOT="/www"
    -D AP_GID_MIN=100
    -D AP_HTTPD_USER="httpd"
    -D AP_LOG_EXEC="/var/log/httpd/suexec.log"
    -D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
    -D AP_UID_MIN=500
    -D AP_USERDIR_SUFFIX="public_html"
    Httpd conf:
    AddHandler fcgid-script .php
    AddHandler fcgid-script .php5
    <VirtualHost *:80>
    DocumentRoot /www
    SuexecUserGroup user user1
    <FilesMatch ".ph(p3?|tml)$">
    SetHandler fcgid-script
    </FilesMatch>

    <IfModule mod_fcgid.c>
    php_admin_flag engine off
    SuexecUserGroup intblogs blogs
    <Directory /www/>
    Options +ExecCGI
    FcgidWrapper /www/cgi-bin/php-fcgi-wrapper .php
    Order allow,deny
    Allow from all
    Require all granted
    </Directory>
    </IfModule>
    </VirtualHost>
    Under docroot I have the below file
    cd /www/cgi-bin
    -rwxrwxr-x. 1 user user1 371 Mar 9 17:17 php-fcgi-wrapper
    vi php-fcgi-wrapper
    #!/bin/sh
    # Set desired PHP_FCGI_* environment variables.
    # Example:
    # PHP FastCGI processes exit after 500 requests by default.

    PHP_INI_SCAN_DIR=/apps/apache/conf/
    export PHP_INI_SCAN_DIR
    PHP_FCGI_MAX_REQUESTS=10000
    export PHP_FCGI_MAX_REQUESTS
    export PHP_FCGI_CHILDREN=1

    # Replace with the path to your FastCGI-enabled PHP executable
    exec /usr/local/bin/php-cgi
     

Share This Page