HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=27)
-   -   PHP Warning: 7 is not a valid MySQL-Link resource (http://www.howtoforge.com/forums/showthread.php?t=56537)

flyguy 14th March 2012 12:02

PHP Warning: 7 is not a valid MySQL-Link resource
 
OK, I've been through all the related threads I could find. The problem is that the cron list of ISPConfig does not get executed.

My error response when executing

/usr/local/ispconfig/server/server.sh

is littered with

PHP Warning: mysql_real_escape_string(): 7 is not a valid MySQL-Link resource in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 184
PHP Warning: mysql_select_db(): 7 is not a valid MySQL-Link resource in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 104

errors. I' ve checked the mysql access using

mysql -h localhost -u root dbispconfig -p

with the user(root) and password as stored in

/usr/local/ispconfig/server/lib/config.inc.php
/usr/local/ispconfig/server/lib/mysql_clientdb.conf

Ive done

cd /tmp
wget http://www.ispconfig.org/downloads/I...-stable.tar.gz
tar xvfz ISPConfig-3-stable.tar.gz
cd ispconfig3_install/install
php -q update.php

The /var/log/mysql.err and /var/mysql.log files are empty. I've had to disable the /usr/local/ispconfig/server/server.sh entry in crontab just to keep my sever from misbehaving.

I have
IServer: 109.74.195.109 (Debian Squeeze/Sid)
ISPConfig 3.0.4.3

Everything worked fine up to the point where I did general system upgrade. My /etc/hosts file looks like this:

127.0.0.1 localhost localhost.localdomain
109.74.195.109 www.subxplore.co.za

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

Anything that I can do next to solve this problem?

till 14th March 2012 15:42

The file /usr/local/ispconfig/server/lib/config.inc.php may not contain the mysql root user or password. If it conatisn the user root on your setup, then you have a installtion error. The mysql user used by ispconfig to connect with the database is always named "ispconfig". The file mysql_cientdb.conf contains the root user which is only used to create new mysql databases.

The error can also be caused by wrong settings in the mysql my.cnf file e.g. when you set timeout values too low.

flyguy 15th March 2012 15:35

Thanks till , good to know what is happening behind the scenes. :)

I changed the root users to ispconfigs, and experimented a bit. The mails get delivered, and adding websites and databases works. BUT the cron list is not deleted, which causes all the actions to be repeated whenever /usr/local/ispconfig/server/server.sh is executed.

Is there any way to remove the tasks from the cronlist?

till 15th March 2012 15:45

Quote:

BUT the cron list is not deleted
You mean sys_datalog? Records in that table have to be kept for 30 days and get removed after that time automatically, do nott delete any records in the database manually or the systemwill fail.

Quote:

Is there any way to remove the tasks from the cronlist?
The dont have to be removed. If they get executed again then the permissions of your database sers are still wrong as a repeated execution indicates that the permissions of the ispconfig mysql user or on multiserver systems the ispcsrv users in the main database are wrong.

Your sytem seams to be really messed up as someone must have altered a lot of ispconfig files manually and entered wrong users there or changed permissions in mysql. You should consider to run a ispconfig update and let the ispconfig updater on all servers that belong to the cluster and let the ispconfig updater reconfigure the permissions in the mysql database.

flyguy 15th March 2012 15:49

No, I mean the ISPconfig jobqueue under the monitor tab. Wrong wording, sorry.

till 15th March 2012 16:06

Login to ispconfig, go to monitor > System state > system log and select loglevel error. If there are any errors listed, delete them by clicking on the delete icon.

flyguy 15th March 2012 16:22

No errors listed.

The Monitor-> Show services shows something interesting :
Web-Server: Offline
FTP-Server: Online
SMTP-Server: Online
POP3-Server: Online
IMAP-Server: Online
mySQL-Server: Online

but my apache server is running. And all the sites are served. The System -.> system services list the web server as activated. Why would it report here as not running?

till 15th March 2012 16:34

Quote:

No errors listed.
Then you might want to debug the server process and post the output:

http://www.faqforge.com/linux/debugg...-of-a-failure/

Quote:

but my apache server is running. And all the sites are served. The System -.> system services list the web server as activated. Why would it report here as not running?
Check that the apache server listens to IP 127.0.0.1 too. Or your mysql permissions are wrong as I explained in the posts above so that the ispconfig server scrippt can not update the server status anymore.

flyguy 16th March 2012 13:30

Went through everything. In the end, my problem seems to be solved when I edit the database according to this link:

http://www.howtoforge.com/forums/arc...p/t-54928.html


All times are GMT +2. The time now is 13:13.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.