473,787 Members | 2,928 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mysql_connect never completes execution

Hi,

I hope someone here has a clue as to what is going on since I am
completely baffled by the following:

I'm working with a PHP/MySQL-web application called Moodle. When this
application is started from a web browser, one of the first things to
happen is a call to mysql_connect which succeds without any problems.

One component of moodle is a so called chat daemon which is just another
PHP-Script. The only difference to the other scripts that together make
up Moodle is that this script is to be started from the command line.

The script also calls mysql_connect from the same line with the same
arguments, but this call to mysql_connect never returns. No connection
ID, no false value, no error message, just nothing. mysql_connect is
called but never completes execution.

And I did wait longer than mysql.connect_t imeout.

Can anybody here offer an explanation?

Regards
Ralf Seliger
Jun 2 '08 #1
2 2024
Ralf Seliger wrote:
Hi,

I hope someone here has a clue as to what is going on since I am
completely baffled by the following:

I'm working with a PHP/MySQL-web application called Moodle. When this
application is started from a web browser, one of the first things to
happen is a call to mysql_connect which succeds without any problems.

One component of moodle is a so called chat daemon which is just another
PHP-Script. The only difference to the other scripts that together make
up Moodle is that this script is to be started from the command line.

The script also calls mysql_connect from the same line with the same
arguments, but this call to mysql_connect never returns. No connection
ID, no false value, no error message, just nothing. mysql_connect is
called but never completes execution.

And I did wait longer than mysql.connect_t imeout.

Can anybody here offer an explanation?

Regards
Ralf Seliger
That's strange. What happens if you run the script from a command line
prompt? Maybe something else is getting involved.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jun 2 '08 #2
Ralf Seliger escribió:
One component of moodle is a so called chat daemon which is just another
PHP-Script. The only difference to the other scripts that together make
up Moodle is that this script is to be started from the command line.
Command line PHP is typically parsed through a different binary and has
a few different options:

http://php.net/manual/en/features.commandline.php

Apart from that, it's likely that your command line binary is using a
different php.ini file. Run <?php phpinfo(); ?from command line to
check the exact settings being used. I'd say display_errors is off and
that's why you get no errors :-?
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor al baño María: http://www.demogracia.com
--
Jun 2 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1866
by: LRW | last post by:
I'm working on some scripts someone else made, and it's littered with repetitive mysql_connect's and mysql_select_db's. For example: // MAKE SURE IT IS A VALID PRODUCT $connection2 = mysql_connect("localhost", "root") or die ("Couldn't connect to the server."); $db2 = mysql_select_db("priceretail", $connection2) or die ("Couldn't select database."); $sql2 = "SELECT dbname FROM productlist WHERE ((accountid = 'printingautomation') OR...
10
5123
by: Alvaro G Vicario | last post by:
I need that my script retrieves data from two different databases so I use mysql_connect() to open two connections. I have only one server, user and password, just two different databases. Simplified, it'd be: $con1=mysql_connect($server, $user, $pass); mysql_select_db($database1, $con1); $res1=mysql_query($sql1, $con1); $con2=mysql_connect($server, $user, $pass);
4
5778
by: Andrew Clark | last post by:
Hello, I am having trouble connecting to my server with mysql_connect(). I can connect via the command line on the server and with phpMyAdmin over our network, but not though mysql_connect(). This is my script: <?php $host = '192.168.100.5'; $user = 'root'; $pass = <password>;
2
2837
by: Sugapablo | last post by:
I have a small test script connecting to a MySQL database. It seems to work, unless I try to use the resource link identifier returned by mysql_connect(); This works and returns all the rows in the table: <?php include("../config.php"); $dbi = mysql_connect($dbhost,$dbuname,$dbpass);
19
8112
by: Michael | last post by:
Hi, I'm trying to do something which should be very simple - connect to the MySQL database. Here is the call, followed by the error msg. $conn = mysql_connect("localhost", "root", ""); Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /var/www/html/buildhw.php on line 13
6
3365
by: GD | last post by:
Hi All, I've got MySQL 5.0.21 running on Windows Server 2003, and php running on Apache on a Linux box (Fedora Core 4). Previously when the pages were running on an IIS server the connection was succesful, now I get: Can't connect to MySQL server on 'SERVER' (13)
1
4378
by: hugo | last post by:
Hello people, There is a problem is that mysql_connect() somehow caches last sessions IP and is not using the one which you put into host place. Has anyone made mysql_connect() from php to multiple SQL servers so that script tries to connect to resolved IPs until it finds one that works? I have set up DNS so that on request sql.example.com it returns two
5
3328
by: yoyoz | last post by:
Help!!!! i am newbie to php, i was trying to establish the connection to another machine (solaris) so that i can retrieve data from the database stored inside there using my own PC. for your information, i am using apache 1.3.27 as my web server, php4 and mysql as i try to build an database with a web portal. the following is the scripts that i have written: <?php $connection = mysql_connect ("202.185.72.62:80","root","") or...
1
1122
by: DelScorcho | last post by:
Hi, I'm using a VB6 application to open MS Access; and it works fine, but when the code completes execution, Access automatically closes (I want it to stay open).... I've written code like this before, and have never had this issue... any thoughts? Here is the code (late binding - using Access 10.0 ref) that simply opens Access: Dim acApp As Access.Application
0
9655
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10169
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.