SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2002
    Location
    London
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Installing PHP5.2 on Redhat

    Can anyone point a newbie to a straightforward tutorial on how I can install PHP5.2 on my new Linux server?

    I downloaded and unpacked the source.

    I just tried the following:

    ./configure --with-mysql --with-apache=/usr/sbin/apachectl

    Which resulted in this:

    creating cache ./config.cache
    checking for Cygwin environment... no
    checking for mingw32 environment... no
    checking for egrep... grep -E
    checking for a sed that does not truncate output... /bin/sed
    checking host system type... i686-pc-linux-gnu
    checking target system type... i686-pc-linux-gnu
    checking for gcc... no
    checking for cc... no
    configure: error: no acceptable cc found in $PATH


    Which means pretty much nothing to me!

    Any help appreviated.

  2. #2
    SitePoint Zealot musher's Avatar
    Join Date
    Nov 2005
    Location
    Hull, England
    Posts
    161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You don't seem to have the necessary compilers installed, or you don't have access to them as the user you are logged in as. Pointing that out is the best I can offer, getting gcc installed could be quite complicated.

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2002
    Location
    London
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've got root access so that's not the problem, I guess they're just not there.

    Hmm... great

  4. #4
    SitePoint Evangelist
    Join Date
    Apr 2005
    Location
    London, UK
    Posts
    506
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by webkuh
    Can anyone point a newbie to a straightforward tutorial on how I can install PHP5.2 on my new Linux server?

    I downloaded and unpacked the source.

    I just tried the following:

    ./configure --with-mysql --with-apache=/usr/sbin/apachectl

    Which resulted in this:

    creating cache ./config.cache
    checking for Cygwin environment... no
    checking for mingw32 environment... no
    checking for egrep... grep -E
    checking for a sed that does not truncate output... /bin/sed
    checking host system type... i686-pc-linux-gnu
    checking target system type... i686-pc-linux-gnu
    checking for gcc... no
    checking for cc... no
    configure: error: no acceptable cc found in $PATH


    Which means pretty much nothing to me!

    Any help appreviated.

    http://www.cyberciti.biz/tips/how-to...se-linux4.html


    HTH

  5. #5
    SitePoint Enthusiast
    Join Date
    May 2002
    Location
    London
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That link looks promising. Step 1, downloaded fine.

    Step 2: rpm -ivh php-5.1.4-1.esp1.src.rpm

    For the following:
    error: cannot create %sourcedir /usr/src/redhat/SOURCES

    Am I meant to edit a config file?

  6. #6
    SitePoint Evangelist
    Join Date
    Apr 2005
    Location
    London, UK
    Posts
    506
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    are you building the rpms as root or user?

  7. #7
    SitePoint Enthusiast
    Join Date
    May 2002
    Location
    London
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    root

  8. #8
    SitePoint Evangelist
    Join Date
    Apr 2005
    Location
    London, UK
    Posts
    506
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to install the package rpm-build and it will create the directories under /usr/src/redhat for you

  9. #9
    SitePoint Enthusiast
    Join Date
    May 2002
    Location
    London
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok... could you tell me how to do that?

  10. #10
    SitePoint Evangelist
    Join Date
    Apr 2005
    Location
    London, UK
    Posts
    506
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by webkuh
    ok... could you tell me how to do that?


    rpmbuild should be in /usr/bin, so you can try running it like:
    /usr/bin/rpmbuild yadayad

    If it still can't find it, you have installed incorrectly, since rpm is an important part of any RedHat based system.

  11. #11
    SitePoint Enthusiast
    Join Date
    May 2002
    Location
    London
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've got the following in /usr/bin:

    rpm2cpio, rpmdb, rpmquery, rpmsign, rpmverify

    Any of those relevant? If not then what next?

    Thanks for your time

  12. #12
    SitePoint Evangelist
    Join Date
    Apr 2005
    Location
    London, UK
    Posts
    506
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by webkuh
    I've got the following in /usr/bin:

    rpm2cpio, rpmdb, rpmquery, rpmsign, rpmverify

    Any of those relevant? If not then what next?

    Thanks for your time

    sorry for the delay...i got a little rosty with linux. ok try opention 1 as a solution then carry on with the tutorial link i posted. if you still ge the same error, then opt for option 2.

    Option1) To rebuild a rpm do the following.

    1. rpmbuild --rebuild NameofSrcRPM.src.rpm
    2. rpm -ivh /usr/src/redhat/RPMS/i386

    now carry on and see if you still get the same error. if yes

    Option 2)

    The first rule of package building is never do anything as root that can be done as user. So first, become root (su -) and make sure your user can write to the /usr/src/redhat/ dir, as this is the dir that is used to build rpms:

    chown username /usr/src/redhat


    Then you do this to get the installed kernel version, and the architecture of your system:

    rpm -q --qf "%{version}-%{release} %{arch}\n" kernel |grep `uname -r`

    The output will be something like this:

    2.4.22-1.2149.nptl i686

    (this command checks against the rpm database, wich is safer than a simple uname -r to get the kernel-version.)

    The first is the kernel version, the second the architecture.

    Using the example above, the command to rebuild the rpm to fit your kernel and architecture is like this, remember to do this as user, not root:

    rpmbuild --rebuild --target i686 --define 'kernel 2.4.22-1.2149.nptl' filename.src.rpm

    You'll need some development packages to build things, use yum to install them, to build against the kernel you have to get the kernel-source package.

    Hope this helps you any, good luck.

  13. #13
    SitePoint Enthusiast
    Join Date
    May 2002
    Location
    London
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've managed to install rpm-build package now. However, when I tried to rebuild the php 5 rpm as per your instructions I got the following response:

    Failed build dependencies:
    bzip2-devel is needed by php-5.1.4-1.esp1.i686
    curl-devel >= 7.9 is needed by php-5.1.4-1.esp1.i686
    db4-devel is needed by php-5.1.4-1.esp1.i686
    expat-devel is needed by php-5.1.4-1.esp1.i686
    gmp-devel is needed by php-5.1.4-1.esp1.i686
    aspell-devel >= 0.50.0 is needed by php-5.1.4-1.esp1.i686
    httpd-devel >= 2.0.46-1 is needed by php-5.1.4-1.esp1.i686
    libjpeg-devel is needed by php-5.1.4-1.esp1.i686
    libpng-devel is needed by php-5.1.4-1.esp1.i686
    pam-devel is needed by php-5.1.4-1.esp1.i686
    libstdc++-devel is needed by php-5.1.4-1.esp1.i686
    openssl-devel is needed by php-5.1.4-1.esp1.i686
    zlib-devel is needed by php-5.1.4-1.esp1.i686
    pcre-devel >= 4.5 is needed by php-5.1.4-1.esp1.i686
    libtool >= 1.4.3 is needed by php-5.1.4-1.esp1.i686
    gcc-c++ is needed by php-5.1.4-1.esp1.i686
    krb5-devel is needed by php-5.1.4-1.esp1.i686
    libc-client-devel is needed by php-5.1.4-1.esp1.i686
    cyrus-sasl-devel is needed by php-5.1.4-1.esp1.i686
    openldap-devel is needed by php-5.1.4-1.esp1.i686
    mysql-devel >= 4.1.0 is needed by php-5.1.4-1.esp1.i686
    postgresql-devel is needed by php-5.1.4-1.esp1.i686
    unixODBC-devel is needed by php-5.1.4-1.esp1.i686
    libxml2-devel is needed by php-5.1.4-1.esp1.i686
    net-snmp-devel is needed by php-5.1.4-1.esp1.i686
    libxslt-devel >= 1.0.18-1 is needed by php-5.1.4-1.esp1.i686
    libxml2-devel >= 2.4.14-1 is needed by php-5.1.4-1.esp1.i686
    ncurses-devel is needed by php-5.1.4-1.esp1.i686
    freetype-devel is needed by php-5.1.4-1.esp1.i686

    Am I supposed to now install all of those?!

  14. #14
    SitePoint Enthusiast
    Join Date
    May 2002
    Location
    London
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking

    I managed to do it! Finally

    So, I thought it would be helpful to other newbies to share my way:

    First off - a Linux friend of mine took a look at my new server and pointed out that almost none of the basic os was installed on my server. No rpmbuild, no gcc no this, no that etc etc. I managed to find a system called up2date which enables you to quickly get the latest automatic installing rpm for all standard linux (red hat for me) modules.

    To get started with up2date go here for instructions:

    http://www.redhat.com/advice/tips/up2date.html

    Once you've registered your server then simply doing the following updates the specified module:

    up2date mysql

    or up2date php

    etc...

    You don't get the error messages where you're told all the missing dependencies you've got to find, instead red hat just installs them, very helpful!

    Unfortuately you can't just run up2date php to get php5 because the currently linux supported version of php for red hat is still version 4(point 3.9 or something like that).

    So, I did manage to install php5.1.4 by following the instuctions here (thanks ma201dq):

    http://www.cyberciti.biz/tips/how-to...se-linux4.html

    However, when I ran the rebuild command I was told by linux that the command rebuild could not be found. Solution:

    up2date rpm-build

    Then I was informed about all the missing dependancies when linux tried the rebuild. Solution:

    Go through all the missing dependancies and do the following:

    up2date [name of missing dependancy]

    then try the rpmbuild command again.

    Finally with step 3 I got another error when I ran the following:

    rpm -Uhv php-5.1.4-1.esp1.i386.rpm

    error: Failed dependencies:
    php = 4.3.9-3.22 is needed by (installed) php-pear-4.3.9-3.22.i386
    php = 4.3.9-3.22 is needed by (installed) php-gd-4.3.9-3.22.i386

    I knew I had a more recent version of php running that the error listed thanks to up2date. So just for this first rpm I ran the following:

    rpm -Uhv --nodeps php-5.1.4-1.esp1.i386.rpm

    This bypassed the dependancy error.

    After that all the remaining rpms installed with:

    rpm -Uhv nameofrpm.rpm

    Restarted apache.

    Everything works!

    Now I just have to learn php!


Bookmarks

Posting Permissions

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