Re: [PHP-DB] semi-newbie | php, mysql & RH Enterprise

2005-01-01 Thread Evan Cooch


That's because you have more problems than you know. Basically it mostly 
boils
down to RH putting things in non-default places.
So I've gathered. :-) I've had no end of problems getting various things 
upgraded on this box, primarily because of the non-standard tack RH has 
taken with a number of things (try compiling SSL into Apache - pain in the 
.  I'm >this< close to 
ditching RH altogether. I've been with RH for years, but I'm getting to old 
to spend so much time futzing around with things.


> As per his suggestion, I went into php.ini and changed the default mysql
> socket to
>
>  mysql.default_socket =/var/lib/mysql/mysql.sock
>
> Then, I rebooted the system, since I'm guessing changes to php.ini aren't
> dynamic (like everything else that parses a config file isn't).
Hmm, I see you're used to the Windows philosphy of rebooting everytime you
"move your mouse" so that the "changes can take effect". All you need do is
restart Apache.
Whoops - yup. :-)

> But, this didn't work.  Two possible answers:
[snip]
> 2) but, perhaps its simply because changes to php.ini aren't being read.
That explains why your changes to mysql.default_socket have no effect.
> In
> fact, this might also be the case:  when I run info.php, I get the
> following for the mySQL bits:
>
> Active Persistent Links0
> Active Links0
> Client API version3.23.49
> MYSQL_MODULE_TYPEbuiltin
> MYSQL_SOCKET/tmp/mysql.sock
> MYSQL_INCLUDEno value
> MYSQL_LIBS   no value
> So, I have a look at the top bits from the info.php output. It tells me
> that the Configuration File (php.ini) Path is /usr/local/lib. Not /etc.
> But, copying php.ini from /etc to /usr/local/lib doesn't seem to have done
> the trick.
The output from phpinfo() will give the definitive location for where PHP
expects to find its php.ini. Did you restart webserver? Search php-general
archives for more info about php.ini.
I've done that, and the thing I've tried which seems to have helped 
somewhat is to put a configure directive into my PHP compile that 
explicitly tells PHP where to find php.ini. I'd seen it before, but again, 
never had to use it. But, at least now, info.php is now showing me that 
php.ini is being readin properly.


> So, something more fundamental. And (tada) I think its because I have two
> versions of PHP on the machine. The old one (4.3.2-19ent) that comes with
> RH Enterprise, and the version I compiled from the PHP 4.3.10 tarball. I
> can confirm that I have 2 binaries.
>
> So, suggestions? I'm total confused by all this. I don't want to use 4.3.2,
> since its got a number of security issues that were corrected with
> 4.3.10.  Should I simply re-install, but try to make sure PHP is NOT
> loaded, and then do it manually myself from the tarball? Or is there a way
> I can get everything to work with the 4.3.10 installation, and ignore the
> older 4.3.2?
Although not strictly necessary it is however strongly recommended that 
you do
remove RH's PHP, and if you're feeling brave I suggest removing Apache too
and install both from source, just follow the instructions in manual. And
while you're at it you might as well ditch RH's MySQL and install MySQL's own
RPMs. That way you can keep on top of all the updates that RH7.3 won't be
having.
Well, getting around the default Apache install is trivial (already done 
that), since the httpd.conf file is very tightly linked to the server 
daemon httpd. What struck me as odd is that PHP was starting up even though 
it wasn't reading the php.ini file (until I told it where to look). This is 
partly what was tripping me up. Strangethis couldn't happen with httpd.

As for uninstalling RH's PHP and mySQL, I'll probably give that a try. I 
can't afford to have the server offline, but none of my current mission 
critical functions require PHP or mySQL, so as long as rpm -e for php and 
mysql doesn't break anything, I'd be willing to try it.

Thanks again to Jason for his various suggestions, and not mention RTFM (or 
any synonym thereof) even once.

I'll stay on this. I hate letting the evil empire (RH, not Micro$oft on 
this occasion) beat me. But I don't have enough hair left to keep pulling 
it out either.  

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] semi-newbie | php, mysql & RH Enterprise

2005-01-01 Thread Jason Wong
On Sunday 02 January 2005 04:55, Evan Cooch wrote:
> > > OK, so I try again, this time using --with-mysql=/usr/bin/mysql - no
> > > luck. Same message.
> >
> >You need to install the mysql-devel package.
>
> Actually, turns out it is installed already. So, that suggestion won't take
> care of the problem.

You're specifying the incorrect directory, it needs to point to the _header_ 
files which in the case of RH is simply

  --with-mysql=/usr

[Bonus tip, most extensions which needs a library will most likely be 
specified in the same way, ie /usr]

NB no matter which MySQL library you use (whether the PHP-bundled one or the 
MySQL one) it will have no bearing on your socket problem.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
I WILL NOT TEASE FATTY
I WILL NOT TEASE FATTY
I WILL NOT TEASE FATTY
I WILL NOT TEASE FATTY

 Bart Simpson on chalkboard in episode 5F05
*/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] semi-newbie | php, mysql & RH Enterprise

2005-01-01 Thread Jason Wong
On Sunday 02 January 2005 05:44, Evan Cooch wrote:
> Jason Wong made several helpful suggestions to my earlier query - alas, non
> of them have panned out.

That's because you have more problems than you know. Basically it mostly boils 
down to RH putting things in non-default places.

> As per his suggestion, I went into php.ini and changed the default mysql
> socket to
>
>  mysql.default_socket =/var/lib/mysql/mysql.sock
>
> Then, I rebooted the system, since I'm guessing changes to php.ini aren't
> dynamic (like everything else that parses a config file isn't).

Hmm, I see you're used to the Windows philosphy of rebooting everytime you 
"move your mouse" so that the "changes can take effect". All you need do is 
restart Apache.

> But, this didn't work.  Two possible answers:

[snip]

> 2) but, perhaps its simply because changes to php.ini aren't being read.

That explains why your changes to mysql.default_socket have no effect.

> In 
> fact, this might also be the case:  when I run info.php, I get the
> following for the mySQL bits:
>
> Active Persistent Links0
> Active Links0
> Client API version3.23.49
> MYSQL_MODULE_TYPEbuiltin
> MYSQL_SOCKET/tmp/mysql.sock
> MYSQL_INCLUDEno value
> MYSQL_LIBS   no value

> So, I have a look at the top bits from the info.php output. It tells me
> that the Configuration File (php.ini) Path is /usr/local/lib. Not /etc.
> But, copying php.ini from /etc to /usr/local/lib doesn't seem to have done
> the trick.

The output from phpinfo() will give the definitive location for where PHP 
expects to find its php.ini. Did you restart webserver? Search php-general 
archives for more info about php.ini.

> So, something more fundamental. And (tada) I think its because I have two
> versions of PHP on the machine. The old one (4.3.2-19ent) that comes with
> RH Enterprise, and the version I compiled from the PHP 4.3.10 tarball. I
> can confirm that I have 2 binaries.
>
> So, suggestions? I'm total confused by all this. I don't want to use 4.3.2,
> since its got a number of security issues that were corrected with
> 4.3.10.  Should I simply re-install, but try to make sure PHP is NOT
> loaded, and then do it manually myself from the tarball? Or is there a way
> I can get everything to work with the 4.3.10 installation, and ignore the
> older 4.3.2?

Although not strictly necessary it is however strongly recommended that you do 
remove RH's PHP, and if you're feeling brave I suggest removing Apache too 
and install both from source, just follow the instructions in manual. And 
while you're at it you might as well ditch RH's MySQL and install MySQL's own 
RPMs. That way you can keep on top of all the updates that RH7.3 won't be 
having.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Using words to describe magic is like using a screwdriver to cut roast beef.
  -- Tom Robbins
*/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] semi-newbie | php, mysql & RH Enterprise

2005-01-01 Thread Evan Cooch
Jason Wong made several helpful suggestions to my earlier query - alas, non 
of them have panned out.

As per his suggestion, I went into php.ini and changed the default mysql 
socket to

mysql.default_socket =/var/lib/mysql/mysql.sock
Then, I rebooted the system, since I'm guessing changes to php.ini aren't 
dynamic (like everything else that parses a config file isn't).

But, this didn't work.  Two possible answers:
1) If I read the PHP docs, I learn that
"mysqli.default_socket string
The default socket name to use when connecting to a local database server 
if no other socket name is specified. "

The key here is 'if no other socket name is specified'. And therein lies 
the problem, I think. With mysql support builtin to PHP, the socket name IS 
specified as /tmp/mysql.sock (according to info.php). But, mysql on RH 
Enterprise WS doesn't put mysql.sock in /tmp, it puts it in 
/var/lib/mysql  And, I see know obvious way to change this.

2) but, perhaps its simply because changes to php.ini aren't being read. In 
fact, this might also be the case:  when I run info.php, I get the 
following for the mySQL bits:

Active Persistent Links0
Active Links0
Client API version3.23.49
MYSQL_MODULE_TYPEbuiltin
MYSQL_SOCKET/tmp/mysql.sock
MYSQL_INCLUDEno value
MYSQL_LIBS   no value
mysql.allow_persistent   On   On
mysql.connect_timeout   60   60
mysql.default_host  no value  no value
mysql.default_password  no value  no value
mysql.default_port  no value  no value
mysql.default_socket  no value  no value
mysql.default_user  no value  no value
mysql.max_links  Unlimited  Unlimited
mysql.max_persistent  Unlimited  Unlimited
mysql.trace_mode  Off  Off
So, my change to the default socket isn't being 'read', even after a system 
reboot. Moreover, when I try changing ANY of these values in the php.ini, 
none of them are read. I even tried changing some other parameters, such as 
maximum execution time, and info.php still shows me the same values (i.e., 
no changes).

So, I have a look at the top bits from the info.php output. It tells me 
that the Configuration File (php.ini) Path is /usr/local/lib. Not /etc. 
But, copying php.ini from /etc to /usr/local/lib doesn't seem to have done 
the trick.

So, something more fundamental. And (tada) I think its because I have two 
versions of PHP on the machine. The old one (4.3.2-19ent) that comes with 
RH Enterprise, and the version I compiled from the PHP 4.3.10 tarball. I 
can confirm that I have 2 binaries.

So, suggestions? I'm total confused by all this. I don't want to use 4.3.2, 
since its got a number of security issues that were corrected with 
4.3.10.  Should I simply re-install, but try to make sure PHP is NOT 
loaded, and then do it manually myself from the tarball? Or is there a way 
I can get everything to work with the 4.3.10 installation, and ignore the 
older 4.3.2?

Thanks again...
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] semi-newbie | php, mysql & RH Enterprise

2005-01-01 Thread Evan Cooch

>
> OK, so I try again, this time using --with-mysql=/usr/bin/mysql - no luck.
> Same message.
You need to install the mysql-devel package.
Actually, turns out it is installed already. So, that suggestion won't take 
care of the problem.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] semi-newbie | php, mysql & RH Enterprise

2005-01-01 Thread Evan Cooch
At 11:34 AM 1/1/2005, Jason Wong wrote:
On Sunday 02 January 2005 00:14, Evan Cooch wrote:
> >You need to install the mysql-devel package.
>
> Hmmm...OK. Why? (just for my understanding). Again, never had this problem
> with RH7.3...
The same situation exists with RH7.3 (and probably most/every version of Red
Hat Linux), it's just probably that you never came across it.
Probably true - I *think* when you selected mySQL for install under RH 7.3, 
it installed everything, which is why I never noticed it. Under RH 
Enterprise, it would seem this is no longer the case.


For reference,
under Red Hat, most PHP extensions that you may wish to compile will require
that you install the corresponding -devel package.
OK - thanks for the enlightenment!

> I did, and saw several (many!) options related to mySQL, but wasn't sure
> what to do with them. The one that seems most related to the 'socket' issue
> is
>
> ; Default socket name for local MySQL connects.  If empty, uses the
> built-in ; MySQL defaults.
> mysql.default_socket =
>
> Do I simply change this to
>
> mysql.default_socket=/var/lib/mysql
That should point to the socket _file_ that is used by RH's implementation of
MySQL. Do a locate/find mysqld.sock.
As per a part of my initial (long) posting, its in 
/var/lib/mysql/mysqld.sock
So, do I change the directive in php.ini to
 mysql.default_socket=/var/lib/mysql/mysqld.sock
This would seem to make sense.
Thanks again.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] semi-newbie | php, mysql & RH Enterprise

2005-01-01 Thread Jason Wong
On Sunday 02 January 2005 00:14, Evan Cooch wrote:

> >You need to install the mysql-devel package.
>
> Hmmm...OK. Why? (just for my understanding). Again, never had this problem
> with RH7.3...

The same situation exists with RH7.3 (and probably most/every version of Red 
Hat Linux), it's just probably that you never came across it. For reference, 
under Red Hat, most PHP extensions that you may wish to compile will require 
that you install the corresponding -devel package.

> I did, and saw several (many!) options related to mySQL, but wasn't sure
> what to do with them. The one that seems most related to the 'socket' issue
> is
>
> ; Default socket name for local MySQL connects.  If empty, uses the
> built-in ; MySQL defaults.
> mysql.default_socket =
>
> Do I simply change this to
>
> mysql.default_socket=/var/lib/mysql

That should point to the socket _file_ that is used by RH's implementation of 
MySQL. Do a locate/find mysqld.sock.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
I'm also pre-POURED pre-MEDITATED and pre-RAPHAELITE!!
*/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] semi-newbie | php, mysql & RH Enterprise

2005-01-01 Thread Evan Cooch
Nice to see I'm not the only one working on Saturday. :-)
Some followups embedded below.

> OK, so I try again, this time using --with-mysql=/usr/bin/mysql - no luck.
> Same message.
You need to install the mysql-devel package.

Hmmm...OK. Why? (just for my understanding). Again, never had this problem 
with RH7.3...


> So, how do I either (i) compile PHP (or tweak php.ini) to tell it to look
> in /var/lib/mysql for the mysql.soc file, or (2) tell mySQL to put the
> mysql.sock file somewhere else (like, presumably, /tmp, so PHP can find
> it)?
Did you actually look in your php.ini? Because there is an entry there just
for this purpose.
I did, and saw several (many!) options related to mySQL, but wasn't sure
what to do with them. The one that seems most related to the 'socket' issue is
; Default socket name for local MySQL connects.  If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =
Do I simply change this to
mysql.default_socket=/var/lib/mysql
Thanks again...
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] semi-newbie | php, mysql & RH Enterprise

2005-01-01 Thread Evan Cooch
At 10:52 AM 1/1/2005, Jason Wong wrote:
On Saturday 01 January 2005 23:26, Evan Cooch wrote:
Thanks for the quick reply. Nice to see I'm not the only one working. :-)
> ./configure  --with-apxs2=/wwwroot/bin/apxs  --with-mysql=/usr/lib/mysql
>
> But, this bombs during configure - I get the following error message:
>
> configure: error: Cannot find MySQL header files under /usr/lib/mysql
>
> OK, so I try again, this time using --with-mysql=/usr/bin/mysql - no luck.
> Same message.
You need to install the mysql-devel package.
Hmmm...OK. Why? (just for my understanding). Again, never had this problem 
with RH7.3...


> So, how do I either (i) compile PHP (or tweak php.ini) to tell it to look
> in /var/lib/mysql for the mysql.soc file, or (2) tell mySQL to put the
> mysql.sock file somewhere else (like, presumably, /tmp, so PHP can find
> it)?
Did you actually look in your php.ini? Because there is an entry there just
for this purpose.
I did, and saw several (many!) options related to mySQL, but wasn't sure 
what to do with them. The one that seems most related to the 'socket' issue is

; Default socket name for local MySQL connects.  If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =
Do I simply change this to
mysql.default_socket=/var/lib/mysql
Thanks again...
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] semi-newbie | php, mysql & RH Enterprise

2005-01-01 Thread Jason Wong
On Saturday 01 January 2005 23:26, Evan Cooch wrote:

> OK, so I do a bit of reading, and see that maybe what I should do is
> explicitly tell PHP where mysql is, during compilation. On this machine,
> whereis mysql yields
>
> mysql: /usr/bin/mysql /usr/lib/mysql /usr/include/mysql /usr/share/mysql
> /usr/share/man/man1/mysql.1.gz
>
> OK, so the mysql binary is in /usr/bin, and the library files are in
> /usr/lib. So, I try a recompile of PHP, using
>
> ./configure  --with-apxs2=/wwwroot/bin/apxs  --with-mysql=/usr/lib/mysql
>
> But, this bombs during configure - I get the following error message:
>
> configure: error: Cannot find MySQL header files under /usr/lib/mysql
>
> OK, so I try again, this time using --with-mysql=/usr/bin/mysql - no luck.
> Same message.

You need to install the mysql-devel package.

> So, how do I either (i) compile PHP (or tweak php.ini) to tell it to look
> in /var/lib/mysql for the mysql.soc file, or (2) tell mySQL to put the
> mysql.sock file somewhere else (like, presumably, /tmp, so PHP can find
> it)?

Did you actually look in your php.ini? Because there is an entry there just 
for this purpose.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
I'm all for computer dating, but I wouldn't want one to marry my sister.
*/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php