Koozali.org: home of the SME Server

Problem with the new PHP4-RPMS..

Thomas

Problem with the new PHP4-RPMS..
« on: October 24, 2000, 10:23:35 AM »
I installed them like Dan suggests but now MySQL is not working in PHP, it tells that it cannot connect to the mysql-server although mysql is running and the command-line tools work with it.

any ideas?

Thomas

Dan Brown

RE: Problem with the new PHP4-RPMS..
« Reply #1 on: October 25, 2000, 01:36:14 AM »
The new ones being 4.0.3pl1-3?  You did also install php-mysql, right?  Did you remove the previous ones first?  Did you also install the e-smith-php4-0.2-2 RPM?  Sorry about the funky version numbering on that; the earlier one never should have had a 4.x version.

If all that's OK, what kind of error messages do you get?

Thomas

RE: Problem with the new PHP4-RPMS..
« Reply #2 on: October 25, 2000, 02:05:38 AM »
yes that is all I did.

The following output is given by mysql-admin at the console with

mysql-admin -p... extended-status
+--------------------------+-------+
| Variable_name            | Value |
+--------------------------+-------+
| Aborted_clients          | 0     |
| Aborted_connects         | 0     |
| Created_tmp_tables       | 0     |
| Delayed_insert_threads   | 0     |
| Delayed_writes           | 0     |
| Delayed_errors           | 0     |
| Flush_commands           | 1     |
| Handler_delete           | 0     |
| Handler_read_first       | 0     |
| Handler_read_key         | 1     |
| Handler_read_next        | 0     |
| Handler_read_rnd         | 15    |
| Handler_update           | 0     |
| Handler_write            | 0     |
| Key_blocks_used          | 0     |
| Key_read_requests        | 0     |
| Key_reads                | 0     |
| Key_write_requests       | 0     |
| Key_writes               | 0     |
| Max_used_connections     | 0     |
| Not_flushed_key_blocks   | 0     |
| Not_flushed_delayed_rows | 0     |
| Open_tables              | 2     |
| Open_files               | 4     |
| Open_streams             | 0     |
| Opened_tables            | 6     |
| Questions                | 4     |
| Running_threads          | 1     |
| Slow_queries             | 0     |
| Uptime                   | 22    |
+--------------------------+-------+

but if I try to open a PHP-Page which contains MySQL-Queries I get:

Warning: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) in /home/e-smith/files/primary/html/mainfile.php3 on line 23
Unable to select database

Also phpinfo tells that I have MySQL 3.23.10 installed although I never installed that version and my actual version is something of the 3.22-tree.

Any suggestions?

Thanks
    Thomas

Thomas

solved but tricky ...
« Reply #3 on: October 25, 2000, 02:11:37 AM »
As I have seen the php tells that it looks at /tmp/mysql.sock for MySQL-Socket.
I took a look at mysql.log and it tells, that the sock is located at /var/lib/mysql/mysql.sock ... so I made a sym-link to it ... and it worked.

But I cannot understand why the rpms installed it wrong!?

Any Hints?

Thanks
     Thomas

Dan Brown

RE: solved but tricky ...
« Reply #4 on: October 25, 2000, 08:31:46 PM »
Are you 100% sure you installed e-smith-php4-0.2-2.noarch.rpm?  The php.ini file created by this RPM should direct PHP to use /var/lib/mysql/mysql.sock.

Thomas

hmm
« Reply #5 on: October 26, 2000, 03:39:00 AM »
I did install it REALLY SURE.

But It can be that I didn't reinstall it as I installed PHP over and over again to get it to work.
Maybe it was that fault.

Anyway
   Thanks for your help.
      Thomas

Jason Miller

RE: hmm
« Reply #6 on: October 26, 2000, 05:36:57 PM »
>
>
>   Are you 100% sure you installed e-smith-php4-0.2-2.noarch.rpm?
> The php.ini file created by this RPM should direct PHP to use
>   /var/lib/mysql/mysql.sock.

To check, type:

rpm -qa | grep e-smith

it'll give a list of all e-smith rpm's installed on the server and this one will be included if its installed.

or better yet:

rpm -q e-smith-php4

to just check specifically for that rpm.

But of course, you probably already knew that.

Dan Brown

RE: hmm
« Reply #7 on: October 26, 2000, 10:43:31 PM »
The other thing to check would be where PHP is looking for php.ini.  From a phpinfo() page, near the top, look for "Configuration File (php.ini) Path"; it should be set to "/etc/httpd/conf".

If that is set correctly, then take a look at /etc/httpd/conf/php.ini, looking for a reference to mysql.sock.  It should specify /var/lib/mysql/mysql.sock.  If not, try to expand-template /etc/httpd/conf/php.ini.

Fran Boon

RE: solved but tricky...
« Reply #8 on: October 28, 2000, 02:32:02 PM »
I can confirm the problem

Here is what I did:

# Clean Install of E-Smith v4.0 (Final)

# Update e-smith-base with Supported update
rpm -Uvh e-smith-base-4.0.12-28.noarch.rpm

# Reboot

# MySQL
rpm -ivh MySQL-3.22.32-1.i386.rpm MySQL-client-3.22.32-1.i386.rpm MySQL-shared-3.22.32-1.i386.rpm
rpm -ivh e-smith-mysql-1.0.0-1.noarch.rpm
mysqladmin -u root password mynewpassword

# PHP
rpm -Uvh apache-1.3.12-2.i386.rpm mod_auth_external-2.1.2-5.i386.rpm
rpm -ivh php-4.0.3pl1-3.i386.rpm php-imap-4.0.3pl1-3.i386.rpm php-ldap-4.0.3pl1-3.i386.rpm php-mysql-4.0.3pl1-3.i386.rpm
rpm -ivh e-smith-php4-0.2-2.noarch.rpm

# At this point, I get these messages:
# In /etc/e-smith/templates/etc/httpd/conf/php.ini/80ModuleSettings: Unquoted string "nocache" may clash with future reserved word at (eval 1) line 1.
# In /etc/e-smith/templates/etc/httpd/conf/php.ini/80ModuleSettings: Unquoted string "private" may clash with future reserved word at (eval 1) line 1.
# In /etc/e-smith/templates/etc/httpd/conf/php.ini/80ModuleSettings: Unquoted string "public" may clash with future reserved word at (eval 1) line 2.
# In /etc/e-smith/templates/etc/httpd/conf/php.ini/80ModuleSettings: Useless use of a constant in void context at (eval 1) line 1.
# In /etc/e-smith/templates/etc/httpd/conf/php.ini/80ModuleSettings: Useless use of a constant in void context at (eval 1) line 1.

# Horde
rpm -ivh horde-1.2.3-1esmith1.noarch.rpm horde-mysql-1.2.3-1esmith1.noarch.rpm
mysql -p < /home/e-smith/files/primary/html/horde/scripts/database/mysql_create.sql
mysqladmin -p reload

# Imp
rpm -ivh imp-2.2.3-1esmith2.noarch.rpm
cd /home/e-smith/files/primary/html/horde
sh install.sh
http://e-smith/horde/setup.php3
sh secure.sh
sh scripts/database/dbpasswd.sh

# Test
http://e-smith/horde/

# I get the following error:
# Warning: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) in /home/e-smith/files/primary/horde-phplib/db_mysql.inc on line 73
# Warning: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) in /home/e-smith/files/primary/horde-phplib/db_mysql.inc on line 73
# Warning: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) in /home/e-smith/files/primary/horde-phplib/db_mysql.inc on line 73
# Warning: Cannot add header information - headers already sent by (output started at /home/e-smith/files/primary/horde-phplib/db_mysql.inc:73) in /home/e-smith/files/primary/html/horde/imp/mailbox.php3 on line 111

# Adding the soft-link to the correct location, fixes the problem:
ln -s /var/lib/mysql/mysql.sock /tmp
http://e-smith/horde/

/etc/httpd/conf/php.ini has the correct entry:
mysql.default_socket = /var/lib/mysql/mysql.sock ;

phpinfo() shows the correct path to php.ini:
/etc/httpd/conf

I also get the weird:
Client API version 3.23.10-alpha

The only reference to /tmp I get is:
session.save_path /tmp

Fran Boon

RE: solved but tricky...
« Reply #9 on: November 06, 2000, 01:24:54 PM »
I've tracked this down a bit further, I think:

strings /usr/local/lib/php/extensions/mysql.so
reveals a reference to:
/tmp/mysql.sock

This seems to over-ride the php.ini setting.

This binary module therefore needs to be rebuilt...

Or a symlink just adding to the RPM...

Evan Montgomery-Recht

RE: solved but tricky...
« Reply #10 on: November 22, 2000, 07:10:36 AM »
Here's the easy solution

do the following:

mysql -p mysql

type in your password

UPDATE user SET password = password('hordemgr') WHERE User = 'hordemgr';

this will change hordemgr password, that is the real problem with the script.

to test this you can do a

mysql -u hordemgr -p horde

if it doesn't give you an error about bad password then IMP should begin to work right.

problem that I see still is that I have to login the first time before anyone uses imp after a reboot using the last command.

evan

Michael Jung

RE: solved but tricky... Yeah, its running...
« Reply #11 on: November 23, 2000, 03:20:44 PM »
I made the mistake to change the hordemgr password different as shown in STEP 9 of Dan Browns Help-Page http://linux.made-to-order.net/article.php&mode=thread&order=0

Because then the last script
"[root@e-smith horde]# sh scripts/database/dbpasswd.sh"
isn't able to run. It took me a few hours, especially because in the morning the bulletin board system wasn't reachable from Germany :-)

E-Smith is really nice, thanks to Dan Brown for the WebMail RPM HowTo.

Michael Jung