Page 1 of 4 123 ... LastLast
Results 1 to 20 of 70

Thread: HOWTO : SuPHP

  1. #1
    Join Date
    Sep 2003
    Posts
    130

    HOWTO : SuPHP

    Here are the steps I did to install suPHP under Redhat 9.0 :

    1- Get suPHP :
    wget http://www.suphp.org/download/suphp-0.5.tar.gz

    2- Unpack the archive and enter into the created directory :
    tar -zxvf suphp-0.5.tar.gz ; cd suphp-0.5/

    3- Copy your current php bin :
    cp -p /usr/local/bin/php /usr/local/bin/php.CLI

    - Download, extract php CGI :
    Make sure you are running Redhat9.0 and you are using PHP 4.3.4 :
    wget http://katou.nebukazar.net/CGI-php-v4.3.4-rh9.tar.gz
    tar -zxvf CGI-php-v4.3.4-rh9.tar.gz ; cp -fp CGI-php-v4.3.4-rh9/php /usr/local/bin/php.CGI

    If you are not using Redhat 9 or you're not using the same PHP version, you can download your PHP version, configure then make. The CGI php version is located under : [PHP-Directory]/sapi/cgi/php

    4- Configure suPHP to your system :
    ./configure --with-apache-user=apache --with-php=/usr/local/bin/php.CGI --disable-checkpath --disable-checkuid --disable-checkgid --with-min-uid=0 --with-min-gid=0

    5- Make :
    make

    6- Before doing make install, please keep a backup of your httpd.conf :
    cp -p /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bak

    7- Make install suPHP :
    make install

    8- Edit your httpd.conf
    - vi or pico /etc/httpd/conf/httpd.conf

    locate :
    <IfModule mod_php4.c>
    AddType application/x-httpd-php .inc .php .php4 .php3 .phtml
    AddType application/x-httpd-php-source .phps
    </IfModule>
    and replace with :
    <IfModule mod_php4.c>
    suPHP_Engine on
    AddHandler x-httpd-php .php
    AddType application/x-httpd-php .inc .php .php4 .php3 .phtml
    AddType application/x-httpd-php-source .phps
    9- Change 1 setting in your php.ini (!! Make sure you are editing the right php.ini file !!):
    vi or pico /usr/local/lib/php.ini

    find :

    ;cgi.force_redirect =
    and change it to :

    cgi.force_redirect = 0
    10- Restart httpd :
    service httpd restart

    suPHP log is installed under /etc/httpd/logs/suphp_log

    If you need more help PM me or contact me at ltellier@eenix.com
    Last edited by nebukazar; 10-31-2005 at 10:01 AM.

  2. #2
    Join Date
    Jul 2004
    Posts
    1
    Quick question,

    This is compiling php barebone right?. So it doesn't include cURL etc etc.

    How do we compile it with say...

    imap, curl, mcrypt, gd, mhash, freetype?

  3. #3
    Join Date
    Sep 2003
    Posts
    130
    Hi,

    suPHP is only a wrapper. It will take the actual php binary and will execute the binary as the user.

    So, you will need to compile the cgi php binary with all the options you want (cURL, mcrypt, etc.)

  4. #4
    Join Date
    Nov 2003
    Posts
    87
    Is there any known problems with changing layout while running suPHP? As we tried now we get this error:

    Status: 0 Content-type: text/html Security Alert! The PHP CGI cannot be accessed directly.
    This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.
    For more information about changing this behaviour or re-enabling this webserver, consult the installation file that came with this distribution, or visit the manual page.

    I think this flag (force-cgi-redirect) was set while installing suPHP. Is it neccassary? How do we solve this problem?

  5. #5
    Join Date
    Sep 2003
    Posts
    130
    hi,

    it is necessary otherwise you won't be able to use php-cgi correctly.

    regards,

  6. #6
    Join Date
    Nov 2003
    Posts
    87
    So there's no solution to get other layouts then?

  7. #7
    Join Date
    Sep 2003
    Posts
    130
    well, as far as I know, no

  8. #8
    Join Date
    Jul 2004
    Posts
    12
    how did you get webmail/squirrelmail/phpmyadmin working?

    everything works here except those 3

  9. #9
    Join Date
    Sep 2003
    Posts
    130
    hi,

    make sure both php are installed on your server. CGI and CLI

    Do you get any errors ?
    Did you take a look @ your logs ?

  10. #10
    Join Date
    Jul 2004
    Posts
    12
    yes, got both installed

    suphp.log:

    [Thu Aug 19 00:13:14 2004] [error] Script /var/www/html/webmail//index.php is not in the DOCUMENT_ROOT (/home/user/domains/domain.com/public_html)

    i know it goes though suphp, but just want to know how you did it?

    and another thing, i actualy have the idea that apache is crashing on something

    [Wed Aug 18 21:23:51 2004] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
    [Wed Aug 18 21:23:51 2004] [notice] Accept mutex: sysvsem (Default: sysvsem)
    [Wed Aug 18 21:25:03 2004] [error] [client 82.192.xx.xx] request failed: URI too long
    [Thu Aug 19 00:11:00 2004] [notice] caught SIGTERM, shutting down
    [Thu Aug 19 00:11:01 2004] [notice] Apache/1.3.31 (Unix) mod_ssl/2.8.19 OpenSSL/0.9.7a PHP/4.3.8 mod_perl/1.27 FrontPage/5.0.2.2510 configured -- resuming normal operations
    Last edited by Naughty Sheep; 08-18-2004 at 03:17 PM.

  11. #11
    Join Date
    Jan 2004
    Posts
    149
    any how-to for freebsd systems?

  12. #12
    Join Date
    Oct 2004
    Location
    Utah
    Posts
    4

    SuPHP on FreeBSD 4.10

    I got SuPHP working on FreeBSD 4.10, the only thing different I had to do was copy the php-4.3.9.tar.gz to another directory and run my normal configure, but without the:
    --with-apxs \
    line. Then I ran make, but NOT make install
    Then I copied sapi/cgi/php to /usr/local/bin/php.CGI and made the other changes. That was it.

  13. #13
    Join Date
    May 2004
    Posts
    148

    php.CGI

    Hi I couldn't find the php.CGI, so i rebuild php with options --enable-cgi

    I've runned configure of suphp like this: ./configure --with-apache-user=apache --disable-checkpath --disable-checkuid --disable-checkgid --with-min-uid=0 --with-min-gid=0

    After restarting I get internal servererrors when requesting php pages.

    In the logging it says:

    [Mon Feb 14 09:16:24 2005] [error] System error: execl() failed (No such file or directory)
    [Mon Feb 14 09:16:24 2005] [info] Executing /home/wil/domains/public_html/forum/index.php as user wil (1017),
    group wil (1017)
    [Mon Feb 14 09:16:24 2005] [error] System error: execl() failed (No such file or directory)

    Can anyone help?
    Last edited by redeye; 02-14-2005 at 04:12 AM.

  14. #14
    Join Date
    Feb 2005
    Posts
    11

    php.CGI

    I tried to do a custom php build, in order to include the cgi.

    I went to directory:
    /usr/local/directadmin/customapache/php-4.3.10
    Which is the version I use, and tried using the configure options (as displayed by phpinfo), and added --enable-cgi

    After running ./configure and make it does not create any php binary in sapi/cgi

    Do I need to run a build with --disable-cli? Because, then I would have to remove pear as well, and I don't know if that is good or bad.

    Cheers

  15. #15
    Join Date
    May 2004
    Posts
    148
    That's exactly what I mean, dito here.

  16. #16
    Join Date
    Feb 2005
    Posts
    11
    I got to creating a CGI edition, by adding --enable-cgi, and REMOVING --with-apxs from the configure line.

  17. #17
    Join Date
    May 2004
    Posts
    148
    Dito here. Just got a problem with --with-php=/usr/local/bin/php.cgi

    It doesn't use that var :s, it keeps looking at /usr/bin/php which is a link to /usr/local/bin/php, so I changed that link to /usr/local/bin/php.cgi

    And now it Rocks, at last. I'm currently testing and, when everything goes well, I will change domain by domain to suphp.

    I will default enable it for new clients .

  18. #18
    Join Date
    Nov 2004
    Location
    Castricum, The Netherlands
    Posts
    50
    In case someone doesn't know for sure: suPHP works perfectly fine with PHP5 (I wasn't sure because I couldn't get it compiled with php5 properly before).

    It's great to watch 'top' now .

    Jochem
    It is Interactive Thinking
    Open Host

  19. #19
    Join Date
    Apr 2005
    Posts
    190
    I don't understand this :

    - Download, extract php CGI :
    Make sure you are running Redhat9.0 and you are using PHP 4.3.4 :
    wget http://katou.nebukazar.net/CGI-php-v4.3.4-rh9.tar.gz
    tar -zxvf CGI-php-v4.3.4-rh9.tar.gz ; cp -fp CGI-php-v4.3.4-rh9/php /usr/local/bin/php.CGI

    If you are not using Redhat 9 or you're not using the same PHP version, you can download your PHP version, configure then make. The CGI php version is located under : [PHP-Directory]/sapi/cgi/php
    In fact i have fedora, what do i have to do ? Because i can't download this file ... Where can i find one for my system and php 4.3.11 ?

    Tanks

  20. #20
    Join Date
    Nov 2004
    Location
    Castricum, The Netherlands
    Posts
    50
    @titam: go to www.suphp.org for suPHP and go to www.php.org/downloads.php to get the latest versions of both products. The versions above is outdated anyway.

    To compile php as a CGI bin, leave out '--with-apxs' and add '--enable-force-cgi-redirect'. Good luck.

    Jochem
    It is Interactive Thinking
    Open Host

Page 1 of 4 123 ... LastLast

Similar Threads

  1. HOWTO: PHP 5 CLI to PHP 5 CGI + suPHP
    By circlesquare in forum How-To Guides
    Replies: 82
    Last Post: 01-29-2015, 08:17 AM
  2. HOWTO: mod_fcgid in CB 2.0, switchable to suphp
    By Jan_E in forum CustomBuild 2.0
    Replies: 8
    Last Post: 02-04-2013, 10:44 AM
  3. looking voor howto suPHP for apache 1.3 and PHP5
    By snaaps in forum MySQL / PHP
    Replies: 4
    Last Post: 03-29-2007, 12:39 AM
  4. [HOWTO] SuPHP
    By 12Media in forum DirectAdmin General Discussion
    Replies: 5
    Last Post: 02-02-2004, 10:43 PM
  5. [HOWTO] SuPHP
    By 12Media in forum How-To Guides
    Replies: 5
    Last Post: 02-02-2004, 10:43 PM

Posting Permissions

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