Forum Moderators: bakedjake

Message Too Old, No Replies

install php in new redhat 7.2. server

./configure: command not found

         

jamie

3:53 pm on Jan 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi me again groan from all regular unix forum users ;);)

just received the ssh login for our new redhat server. so am busy installing the necessary stuff, which in my case is mysql and php.

mysql was installed from an rpm and went perfectly. i then logged in and changed the mysql root password. (and jamie looked down and he was pleased)

i then downloaded the newest version of php:
php-4.3.0.tar.gz

uploaded and unzipped to /usr/local/src/ and then (following a guide i found online) tried the following:

# ./configure --with-mysql=/usr/local/mysql --enable-track-vars --with-xml --with-apxs=/usr/local/apache/bin/apxs

# make

# make install

however the server returned a ./configure: command not found

a) why might this be?
b) do the installation instructions look ok to an expert?
c) might it be easier for me as a novice to install a php rpm?

many heartfelt thanks

dingman

4:03 pm on Jan 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



c) might it be easier for me as a novice to install a php rpm?

Absolutely. In most cases I would reccomend it for an expert as well. My theory is that package management systems were invented for a reason, and you might as well benefite from them. They make upgrades much, much easier, and I rarely find a good reason not to use them - most such purposes are adequately filled by building the package from source. But I digress.

Notwithstanding my reccomendation that you use an RPM to get php installed, knowing why your configure command didn't work is probably a good thing, so I'll explain my best guess as to what happened.

'./configure' means "the file in this directory named 'configure'". When it is the only thing in a command, or the first thing in the command, it will be interpreted as "run the file in this directory that is named 'configure'". Most likely "this directory" was /root rather than /usr/local/src/<php-source-directory>, and since the 'configure' file you were trying to run was part of the PHP source distribution, it was in the same directory that all the other PHP source code was in.

Again, using an RPM is almost certainly the best way for you to install PHP, and to upgrade it in the future. But understanding how things work in *nix land is generally useful. I'm glad to help.

[edited by: dingman at 4:21 pm (utc) on Jan. 21, 2003]

David

4:18 pm on Jan 21, 2003 (gmt 0)

10+ Year Member



Hi Jamie,
If you are going to admin your own Redhat server, you should check out the RedHat Network and sign up. It is a $60.00 a year charge for the service. Things like installing PHP are very simple. You are notified of security updates and with a simple command you can update your server.

dingman

4:21 pm on Jan 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Seconded.

jamie

4:44 pm on Jan 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



thank you very much dingman.

i have just downloaded the latest rpm from rpmfind and have run

rpm -i php-4.1.2-7.2.6.i386.rpm

but it now gives me

error: failed dependancies:
libcurl.so.1 is needed by php-version
libmm.so.11 is needed by php-version
libpspell-modules.so.1 is needed by php-version
libpspell.so.4 is needed by php-version

i have looked online and it seems as though i have to install each one individually. e.g. rpmfind has the following available for download:

curl-7.8-1.i386.rpm (for libcurl.so.1)
mm-1.1.3-8.i386.rpm (for libmm.so.11)
pspell-0.12.2-3.i386.rpm (for libpspell-modules.so.1 and libpspell.so.4)

is it simply case of installing each .rpm and then trying to install the php.rpm again?

and to install them would i use the -i operator or the -U:

rpm -U pspell-0.12.2-3.i386.rpm?

much appreciated dingman

<added>will definitely register - thanks for tip</added>

jamie

6:09 pm on Jan 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



being an impatient person i went ahead and did the above, and it worked! :)

php -v gives me 4.1.2

thing is when i upload phpinfo.php to the htdocs directory, my browser tries to download the file as opposed to displaying it.

the following line is in my httpd.conf

AddType application/x-httpd-php .php .php3 .phtml

something else is obviously missing ;)

many thanks

[edited by: jamie at 6:28 pm (utc) on Jan. 21, 2003]

dingman

6:19 pm on Jan 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



From one of my machines' httpd.conf file:

#
# And for PHP 4.x, use:
#
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

jamie

7:01 pm on Jan 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



thanks again dingman

jamie

9:04 pm on Jan 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



that hasn't worked unfortunately - the browser still wants to download the file, not display it...hmmm...more investigation

i have just added the LoadModule, so it now looks like

LoadModule php4_module /usr/lib/apache/libphp4.so
AddType application/x-httpd-php .php .php3 .phtml
AddType application/x-httpd-php-source .phps

AND IT WORKS!

i have just printed out 'hello world' (oddly enough phpinfo didn't seem to work, but echo hello world did)

wow - that only took 8 hours :):):)

i have learnt more about webservers today than i would have believed possible. we'll make a sys admin out of me yet!

good night all, thanks for support

dingman

9:23 pm on Jan 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Oh, yeah. I suppose I probably ought to have double checked that you were loading the module ;)

jamie

8:33 am on Jan 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi dingman

back again....

up this morning to load phpmyadmin:

i unzipped to folder, changed the config.inc.php correctly and then got following message when i call it in the browser:

cannot load MySQL extension, please check PHP Configuration

this tells me that i need the php-mysql package. ok

> then download and install php-mysql-4.1.2-7.2.6.i386.rpm

this gives me
failed dependancies of libmysqlclient.so.10

> find the appropriate .rpm at rpmfind - this actually happens to be the full mysql package:
mysql-3.23.54a-3.72.i386

> now i already installed a mysql package yesterday, the :
mysql-3.23.54a-1.i386.rpm

> i now try a rpm -i mysql-3.23.54a-3.72.i386 and it gives me a

MySql conflicts with mysql-3.23.54a-3.72 error

i think it has something to so with incorrect versions? shall i uninstall the mysql i installed yesterday and do a fresh install with the newest package?

thanks

p.s. the mysql rpm which i installed yesterday appears to work correctly. but obviously i doesn't work with php without the php-mysql rpm

hakre

8:41 am on Jan 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi jamie,

yes you should. mysql two time rpm'ing will bite each other.

but for the failed dependencies prob, you've to check which the dependencies of libmysqlclient.so.10 are and which you'll need to update.

i don't think it's the mysql server, because the libmysql only communicates with the server, they don't share binaries (if i'm not completely wrong).

jamie

9:30 am on Jan 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi hakre,

i am unable to uninstall the mysql .rpm's installed yesterday - it says that

MySql-3.23.54a-1-i386.rpm is not installed

and

MySql-client-3.23.54a-1-i386.rpm is not installed

hmmmm..

and yet i can log in perfectly to mysql with the root password, and it tells me vesion 3.23.53 is running and database test exists.

i think maybe the correct versin of mysql is installed, i just need to download the libmysqlclient.so.10 and install it.

but for the failed dependencies prob, you've to check which the dependencies of libmysqlclient.so.10 are and which you'll need to update.

i don't think it's the mysql server, because the libmysql only communicates with the server, they don't share binaries (if i'm not completely wrong).

what exactly to you mean?

thanks

<added>

the only way of installing the libmysqlclient.so.10 is apparently to install the full mysql-3.23.54a-3.72.i386.rpm

but as stated above i get the error:

MySql conflicts with mysql-3.23.54a-3.72

obviously i need some other way of uninstalling mysql than trying the rpm -e package.rpm

that way i can do a complete reinstall. do you know how?

hakre

10:00 am on Jan 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



i'm not a redhat/rpm user so i can't tell you. sorry about this. :(

if php is running as module, you've to stop apache first, before you can replace/delete files because they are in use.

if the .so is part of the rpm, then i would do this.

added:
man rpm

jamie

12:06 pm on Jan 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



when i

rpm -qa ¦ grep -i mysql the following are returned:
MySql-client-3.23.54a-1
MySql- 3.23.54a-1

these are the packages i installed yesterday.

yet no ammount of

rpm -e package.rpm can uninstall them

it simply says package.rpm is not installed?

furthermore i am unable to update using -Uvh, for reasons explained above.

is there a way to manually uninstall?

hakre

12:29 pm on Jan 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



have you tried this:

rpm -e --allmatches mysql+

?

Gorufu

1:44 pm on Jan 22, 2003 (gmt 0)

10+ Year Member



#msg13
and yet i can log in perfectly to mysql with the root password, and it tells me vesion 3.23.53 is running and database test exists.

It appears that MySQL-3.23.53 is installed on your server

the only way of installing the libmysqlclient.so.10 is apparently to install the full mysql-3.23.54a-3.72.i386.rpm

The client and/or development packages for MySQL-3.23.53 may not have been installed on your server. That could be why you originally had libmysqlclient.so.10 errors.

---------------------------------------------

To upgrade from MySQL-3.23.53 to MySQL-3.23.54a you will need the following packages

MySQL-3.23.54a-1.i386.rpm
MySQL-client-3.23.54a-1.i386.rpm
MySQL-devel-3.23.54a-1.i386.rpm
MySQL-shared-3.23.54a-1.i386.rpm

Upgrade each package separately using the following commands
--no-deps will stop the dependency errors

rpm -Uvh MySQL-3.23.54a-1.i386.rpm --no-deps
rpm -Uvh MySQL-client-3.23.54a-1.i386.rpm
etc, etc

If nothing happens when doing rpm -Uvh for a package it might not have been installed. Use rpm -ivh to install the package

eg
rpm -ivh MySQL-client-3.23.54a-1.i386.rpm

When MySQL is Upgraded your server may appear to hang after restarting. Press ENTER if it appears to hang. Then you can Upgrade/install the other packages.

dingman

2:42 pm on Jan 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



cannot load MySQL extension, please check PHP Configuration

Um, guys 'n gals, should we maybe ask Jamie whether 'extension=mysql.so' exists in the php.ini file, and if so whether the file exists in a directory that PHP will look for it in? It seems like the easiest possible problem to fix. Not that I think there's been rapant bad advice given, just that a good starting point was skipped.

i now try a rpm -i mysql-3.23.54a-3.72.i386 and it gives me a

MySql conflicts with mysql-3.23.54a-3.72 error

rpm -U mysql-3.23.54a-3.72.i386 might work better. If you have a bunch of interdependent packages, it also works to do 'rpm -Uvh package-1.rpm package-2.rpm package-3.rpm', and that way rpm will sort out what order to do it in in order not to have dependency problems. I'm always warry of options to ignore dependency information. Sometimes they are necessary, but use them with great caution.

jamie

3:18 pm on Jan 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



(gorufu - thanks for a very complete explanation - If dingman's tip fails... I'll know exactly what to do :) )

dingman, here is my /etc/php.ini

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
;
; If you wish to have an extension loaded automatically, use the following
; syntax:
;
; extension=modulename.extension
;
; For example, on Windows:
;
; extension=msql.dll
;
; ... or under UNIX:
;
; extension=msql.so
;
; Note that it should be the name of the module only; no directory information
; needs to go here. Specify the location of the extension with the
; extension_dir directive above.

so it seems as though extension=mysql.so does not exist.

I have now uncommented the extension=msql.so and changed it to

extension=mysql.so

i then restarted apache and tried to log into phpmyadmin and the browser again gave me a

"cannot load MySQL extension,
please check PHP Configuration."

andreasfriedrich

3:37 pm on Jan 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might want to check/set extension_dir as well.

Use

locate mysql.so
to locate your mysql.so file. Use the path given by that command as your extension_dir.

Andreas

jamie

3:45 pm on Jan 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi andreas,

i can't locate mysql.so - only /var/lib/mysql.sock

find / -name 'mysql.so*' -print returns only:

/var/lib/mysql.sock

thanks

<added>

gorufu

It appears that MySQL-3.23.53 is installed on your server

sorry gorufu, my mistake, it says version 3.23.54

</added>

David

4:17 pm on Jan 22, 2003 (gmt 0)

10+ Year Member



If you have your server registered for the redhat network why would you not use their rpm's? Many times they chamge a version number slightly and add security patches to them. My 7.2 server mysql is 3.23.54a.3.72. I have never had to mess with the config problems like you are having when I used redhat rpms. You also may be starting a never ending process of dependancy problems. When the next security update for mysql or php comes out the redhat rpms may fail and you will be doing this all over.

If it were me I would rpm -e (thats remove) all non redhat rpms and go to the redhat site and select the packages you need. Redhat will then package them in a tar file and you can download them and and install. rpm -Uvh

I could never feel comfortable with dependancy errors on mission critical Apps.

hakre

4:31 pm on Jan 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



the problem is that -e does not work on the mysql rpm anymore.

David

4:48 pm on Jan 22, 2003 (gmt 0)

10+ Year Member



try it with 0ut the .rpm just...

rpm -e packagename

Or run the command up2date -p and update the database at redhat and see what it wants to do with the versions it may then want to update the packages.

andreasfriedrich

4:50 pm on Jan 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



the problem is that -e does not work on the mysql rpm anymore

Is that just your own experience hakre or could you cite any source explaining why and on what systems the erase option does not work.

rpm -e -v -v --nodeps --test mysql
returns
erase: mysql-3.23.54a-3.70 has 162 files, test = 1
. So I guess erase would work on this box.

Andreas

andreasfriedrich

4:54 pm on Jan 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



David has a good point there. It is best to stay with the rpms provided by your distribution´s vendor unless you know what you are doing and are prepared to manually keep your software up2date. Otherwise these dependency problems will keep bugging you and will prevent you from using your distro´s automatic update feature.

I manually installed php, perl, apache, mod_ssl, aspell on my redhat 7.0 distribution, since I needed some features not provided with the redhat 7.0 versions. Running up2date and keeping those packages up2date was a major hassle afterwards. I reverted back to the original rpms.

I´m downloading debian right now in the hope that maintaining an up2date system will become easier.

i can't locate mysql.so

It seems that php-mysql is not installed. Check using

rpm -q php-mysql
.

Andreas

hakre

5:07 pm on Jan 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



andreas, that -e on the mysql package(s) does not work is a quote from jamie. also, the update and install switches only produced errors, so an overwriten wasn't possible either. that's what the discussion was about.

going on with debian now? tought guy. make an update everyday and fix the probs after update fast then. if you want to be uptodate, that's really an everyday job with debian. ;)

dingman

5:19 pm on Jan 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I´m downloading debian right now in the hope that maintaining an up2date system will become easier.

It is. :) That's why I've been relatively quiet about the RPM discussion.

make an update everyday and fix the probs after update fast then. if you want to be uptodate, that's really an everyday job with debian.

Depends on how bleeding edge you want to be. I have two machines on Debian right now, a server and my workstation. On the server, I value stability and security over the newest features in every piece of software, so it runs "stable" - which is very deserving of the name. I also subscribe to debian-security-announce, so I get an e-mail every time there is a security-related update to "stable". Most of the time, the update is for a package I don't even have installed on the server. When it is something I have installed, upgrading is as easy as 'apt-get update; apt-get install'.

Of course, on the workstation I follow the "unstable" branch, which does change every day, update much more often, and have problems with the updates from time to time. But frankly that's just because I want to play with the new stuff. It has nothing to do with maintaining a usable or secure system. I'd be crazy to try to run a production server that way.

andreasfriedrich

5:23 pm on Jan 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorry hakre! It took me a while1 to understand that your post was in reply to David´s suggestion to remove the mysql rpms with
rpm -e
and that you were simply citing what Jamie said in msg 15.

David is right though that to erase packages you just use the package name without extension.

If somehow the rpmdb got out of sync with the real situation

rpm --rebuilddb
n´sync it again ;)

that's really an everyday job with debian

... but a scriptable one I guess.

That sounds good Andrew. :)

Andreas


1 I´m somewhat slow sometimes :( - Using the quote style code when quoting really helps all those slow people like me to realize what is a quote and what isn´t.

jamie

5:39 pm on Jan 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



it seems as though gorufu was on the right lines. i have just installed the devel and shared libraries .rpm's and now i have now been able to install php-mysql and .....

connect to phpmyadmin BUT.. i get the following

Welcome to phpMyAdmin 2.3.3pl1

Error

MySQL said:

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

*groan*

It looks as though david is right when he says stick to the redhat versions, and to be honest I am thinking: delete everything to do with php and mysql and start again - but this still leaves me with the problem of how to delete mysql.

I need some way of uninstalling the versions of MySql which I presently have, or, forcing an upgrade. these are the current php/mysql packages which i have manually installed since yesterday:

MySQL-client-3.23.54a-1
MySQL-3.23.54a-1
MySQL-shared-3.23.54a-1
MySQL-devel-3.23.54a-1
webmin-1.050-1.noarch.rpm
php-mysql-4.1.2-7.2.6
(the next 4 are the extras i installed because of failed dependancies)
curl-7.8-1.i386.rpm
pspell-0.12.2-3.i386.rpm
mm-1.1.3-8.i386.rpm
webmin-1.050-1.noarch.rpm

really appreciate the help - i feel sure we are getting somehwere :)

This 41 message thread spans 2 pages: 41