Announcement

Collapse
No announcement yet.

Php5 / Mysql 4.1.9 Howto

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • IWorx-Chris
    replied
    Yep, you'd have to build from source and change the SPEC file to build the cli instead of the cgi Dave. And yes, you'll still need the --with <distro> string.

    Chris

    Leave a comment:


  • Guest's Avatar
    Guest replied
    A few questions:

    How do we get the CLI version installed?

    Would we have to build from source if not?

    Would we still use "--with rhe4x" if we're on CentOS 3.x?

    Thanks,
    Dave

    Leave a comment:


  • IWorx-Chris
    replied
    When you said php5 as module and CGI what do you mean exactly ?
    Both /usr/bin/php and the .so that is run within apache are built / installed using the above method.

    Is php5 is installed in /usr under php5 or under php ?
    In "the usual spot", the same as our php4 RPMs and the php cgi interpreter is at /usr/bin/php.

    the Apache conf file is created as php.conf or php5.conf ?
    php.conf

    Well i'm sure you understand why I ask this :-p
    Does this rpm will erase previous install of php4 or not ? ( :-p )
    It will, it's no different than upgrading from 4.3.9 to 4.3.11 it just seen as "the next version" and will overwrite previous versions.

    Chris

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Chris,

    When you said php5 as module and CGI what do you mean exactly ?

    Is php5 is installed in /usr under php5 or under php ?

    the Apache conf file is created as php.conf or php5.conf ?

    Well i'm sure you understand why I ask this :-p
    Does this rpm will erase previous install of php4 or not ? ( :-p )

    Thanks and well done as usual
    Pascal

    Leave a comment:


  • IWorx-Chris
    replied
    PHP5 / MYSQL 4.1 MINI HOWTO:

    We are not (yet) releasing RPMs as php5 is not officially part of the iworx RPM set so you'll have to build the RPMs yourself. This HOWTO is meant to help you out getting a php5 / mysql 4.1 box running.

    1. Install rpmbuild if needed

    Code:
    yum install rpm-build
    2. Build the MySQL server for your platform. This needs to be done first so we can link php5 against it.

    Code:
    rpmbuild --rebuild --with rhe4x http://updates.interworx.info/iworx/SRPMS/experimental/mysql-4.1.12-100.iworx.src.rpm
    NOTE: The previous command may barf out a list of dependencies that need to be installed. Just 'yum install' them and then continue.

    3. Upgrade your system to MySQL 4.1

    Code:
    rpm -Uvh RPMS/i386/mysql*.rpm
    4. Build PHP5 for your platform:

    NOTE: YOU MAY NEED TO INSTALL MANY -DEVEL RPMS FOR THIS BUILD TO WORK.

    Code:
    rpmbuild --rebuild --with rhe4x http://updates.interworx.info/iworx/SRPMS/experimental/php-5.0.4-100.iworx.src.rpm
    5. Upgrade your system to PHP5

    Code:
    rpm -Uvh RPMS/i386/php*.rpm
    This will give you php 5 + mysql 4.1 with php as a module and as a cgi.

    THIS HAS ONLY BEEN TESTED ON CENTOS 4.1 AND CENTOS COMES WITH MYSQL 4.1 SO I USED THE DEFAULT MYSQL 4.1 FOR CENTOS (I.E. SKIP THE FIRST FEW STEPS UP TO THE PHP BUILD.

    THIS IS STILL DEEMED EXPERIMENTAL AND WE CAN'T DIRECTLY SUPPORT IT AS WE WOULD OTHER IWORX PROVIDED RPMS.

    Chris

    Leave a comment:


  • IWorx-Chris
    replied
    Paul,

    You should be all set, I'll be posting a HOWTO as soon as I get the info together.

    Chris

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Well, the other option is to modify mod_php's source code, adding "5" to everything. So you could load "mod_php5" instead of "mod_php". If it checks for a modified content type as well, they may work along side each other. The problem here is you need to modify the code on EVERY release of PHP. Well... with a context-sensitive patch...

    Leave a comment:


  • Guest's Avatar
    Guest replied
    In fact I don't know

    It is the only rules I found to have php5 as cgi running on my box.

    I've tried a lot of things but The only one that work is
    - to copy the php binary somewhere in the docroot
    - add
    AddHandler application/x-httpd-php5 .php5
    Action application/x-httpd-php5 /cgi-bin/php5-cgi

    If I change the Action for the real path of the php binary it doesn't work, if I add a ScriptAlias, it also doesn't work.

    Maybe there is a better way to have php5 as cgi and php4 as module both running on the same box, but I didn't find it

    Pascal

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Originally posted by IWorx-Chris
    What command are you trying to run from the browser here Pascal? php itself? Or are you trying to run a script that uses PHP #!/usr/bin/php style?

    The php binary itself doesn't need to be in the webspace, just as /usr/bin/perl doesn't for perl based CGI scripts. There must be something else going on here.

    Chris
    I try to launch a php script without the #!/usr/bin/php as Perl does (in my case #!/usr/php5/bin/php)

    something like
    http://domaine.com/script.php5

    I understand what you mean, but the log did return me an suexec error

    But idealy I don't xant have to use the sembang

    In my case when I used
    Action application/x-httpd-php5 /usr/php5/bin/php
    it didn't work
    Pascal
    Last edited by pascal; 06-20-2005, 07:15 PM.

    Leave a comment:


  • IWorx-Chris
    replied
    Going to try Paul, it's been a bigger pain than I had wanted trying to generalize the php5 RPM. But I will give it a go today and let you know.

    Chris

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Originally posted by IWorx-Chris
    Btw, PaulK, will be finisihing up your box today I hope.

    Chris
    Thanks Chris, I see that MySQL 4.1.10a has been on there for a bit, but PHP has not been upgraded to 5 yet. Are you planning on doing that today?

    Leave a comment:


  • IWorx-Chris
    replied
    What command are you trying to run from the browser here Pascal? php itself? Or are you trying to run a script that uses PHP #!/usr/bin/php style?

    The php binary itself doesn't need to be in the webspace, just as /usr/bin/perl doesn't for perl based CGI scripts. There must be something else going on here.

    Chris

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Well pascal, that is the best thing to do I can think of at the moment. (You should be able to put the binary in the skel directory, and run some script to update the binary in everyone's directories. Doing things this way is no different then having the individual users use their own cgi scripts, which just happen to be the php5 binary in this case. The other option is to modify the suEXEC binary to skip the requirement to have target UID/GID match script UID/GID.

    Leave a comment:


  • Guest's Avatar
    Guest replied
    The error is because the doc_root is not set correctly

    [2005-06-18 10:10:59]: uid: (xxx/zzzzz) gid: (xxx/xxx) cmd: php
    [2005-06-18 10:10:59]: command not in docroot (/usr/php5/bin/php)
    indeed, if I copy the php binary in /home/account/domain.tld/html/cgi-bin/
    then chown it to the user account
    and change the vhost config file to add
    AddHandler application/x-httpd-php5 .php5
    Action application/x-httpd-php5 /cgi-bin/php

    ScriptAlias /cgi-bin/ /home/hebergem/hebergement-serveurs.fr/html/cgi-bin/
    then it works fine

    The pbm with this mean that I'll have to copy the php binary in the doc root.
    I wouldn't do this for every account that would like to use php5

    Have you got an idea

    Pascal
    Last edited by pascal; 06-18-2005, 03:24 AM.

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Thanks Chris. I forgot about the minimum UID restriction. That's what was killing me.

    Leave a comment:

Working...
X