[PHP] MySQL Connection problem
Hi, I have Apache 2, PHP 5 and MySQL 4.1 installed on an XP pro box. I have created a new database 'ijdb' with a single table 'joke' and have entered data into two of the three fields in the table. I can access the database / tables / data from a command prompt. However, when I try to connect through WAMP I either receive a 'Unable to connect to the database server at this time.' error message - which is my default error message, or, I receive a blank window in IE / Mozilla / Opera etc and no error messages. I have tried removing the @ from the file and this has no effect - interesting?! The error logs do not reveal anything that indicates a missing table / field. I wonder if anyone has any ideas ? Cheers, Mike
[PHP] PHP-MySQL connection problem
Hi, My server is running on shared server which has support for PHP 4.1.2. I installed mySQL for our shared server. I also installed phpMyAdmin. Both are running properly. But I am facing following problems 1) If there is any error in the script - It is not getting displayed - screen is becoming blank, so it is becoming very difficult for me to make out any mistake. 2) I am trying to send email - but not getting any email. This is the script ? $mailBody = This is one line \ n This is a second line \n\n this is a third line; $boolMail = mail ([EMAIL PROTECTED], Test mail, $mailBody); print (Email has been send ); ? I am getting print statement but not the mail. Any extra settings are required ? Thanks in advance Manisha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP-MySQL connection problem
My server is running on shared server which has support for PHP 4.1.2. I installed mySQL for our shared server. I also installed phpMyAdmin. Both are running properly. But I am facing following problems 1) If there is any error in the script - It is not getting displayed - screen is becoming blank, so it is becoming very difficult for me to make out any mistake. Check PHP.ini and make sure display_errors is ON. 2) I am trying to send email - but not getting any email. This is the script ? $mailBody = This is one line \ n This is a second line \n\n this is a third line; $boolMail = mail ([EMAIL PROTECTED], Test mail, $mailBody); print (Email has been send ); ? I am getting print statement but not the mail. Any extra settings are required ? Just the settings in PHP.ini in the mail section. Ensure you are even using a PHP.ini to begin with, too. If there isn't one, PHP will use its own defaults. Load up a page that has just ? Phpinfo(); ? in it and in the first block shown, it'll tell you where PHP thinks it's PHP.ini file is. Edit that file if it's there. If it's not, then look for a PHP-ini.dist or PHP-ini.recommended in the files you downloaded and rename it to PHP.ini and copy it to that location. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP-MySQL connection problem
My server is running on shared server which has support for PHP 4.1.2. I installed mySQL for our shared server. I also installed phpMyAdmin. Both are running properly. But I am facing following problems 1) If there is any error in the script - It is not getting displayed - screen is becoming blank, so it is becoming very difficult for me to make out any mistake. Check the php.ini values (or use ?php phpinfo();? to see what your values are for error_reporting and error_logging and display_errors. Your errors may be going into the Apache error log or even some other separate log where they belong. If so, your ISP is to be commended for their vigilance and Security focus. 2) I am trying to send email - but not getting any email. This is the script ? $mailBody = This is one line \ n This is a second line \n\n this is a third line; For one thing use \r\n not just \n. Spec. $boolMail = mail ([EMAIL PROTECTED], Test mail, $mailBody); print (Email has been send ); ? I am getting print statement but not the mail. Any extra settings are required ? if ($boolMail){ print Email has been queued.BR\n; } else{ print Couldn't even queue email, much less send it!BR\n; } Check your sendmail logs to see what's going on. Also check the sendmail and SMTP settings in php.ini (or ?php phpinfo();? and see if they make sense. Also ask your ISP if PHP (user 'nobody', probably) is even *ALLOWED* to send email. Maybe not. If they were paranoid enough to fix the logging, they may have dis-allowed PHP to send email. -- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP-MySQL connection problem
Hi, I tried to display phpinfo and I am getting following values display_errors On On display_startup_errors On On error_append_string no value no value error_logno value no value error_prepend_string no valueno value error_reporting 1 1 (Still there is no display of error) sendmail_from[EMAIL PROTECTED] [EMAIL PROTECTED] sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i short_open_tagOn On SMTP localhost localhost I changed the script as follows, now it is giving error that - can not even queue - btw where the queue is stored ? and where can I see the sendmail log ? ? $mailBody = This is test email; $boolMail = mail ([EMAIL PROTECTED], Test mail subj from local linux server - PHP, $mailBody); if ($boolMail){ print Email has been queued.; } else{ print Can not even queue email; } ? I tried giving mail directly from sendmail going to /usr/sbin - I am not sure how to give commands in unix but I tried following block, --- shellcd /usr/sbin shellsendmail manisha From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Test from new aurica kl;efkvg;lkf rkfkrjek sdjkfjsd ^D - to terminate it message given - Failed to send message to any users Now how shall I proceed ? Thanks and regards Manisha
[PHP] PHP/mysql connection problem
Hey all, this is probably more to do with Mysql but I figured i'd ask here as well. The problem: When connecting to the mysql server on the local machine its fine, but when you connect to a remote machine eg $db = mysql_connect(x.x.x.x, user, password); and request something from the database, it connects, BUT it takes about 5 minutes... any ideas??? Jo
Re: [PHP] PHP/mysql connection problem
Jo wrote: The problem: When connecting to the mysql server on the local machine its fine, but when you connect to a remote machine eg $db = mysql_connect(x.x.x.x, user, password); and request something from the database, it connects, BUT it takes about 5 minutes... I have an idea, yes. Make sure that the machine you are connecting to can do a reverse lookup on the machine you are connecting from. Meaning, either your DNS has to be properly configured to include thie remote machine, or you need to add it to your /etc/hosts file. To see whether I'm even on the right track, try to telnet or ftp manually rather than make a database connection. You should see the same timeout condition occur, because the remote machine will basically try to see who is connecting, and if it can't figure it out, it's going to first time out before giving up. Happy hacking. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP/mysql connection problem
Hey all, this is probably more to do with Mysql but I figured i'd ask here as well. The problem: When connecting to the mysql server on the local machine its fine, but when you connect to a remote machine eg $db = mysql_connect(x.x.x.x, user, password); and request something from the database, it connects, BUT it takes about 5 minutes... that depends on load on the server or network i think... how much info are you tring to get? try it will a very small amount and see if there is a difference...
[PHP] MySQL connection problem?
Here is my situation: 1. Two hosts: HA and HB, both connected with each other via Internet. 2. On HA there is a MySQL server SA and a Web server WA, while on HB there is a SB and a WB. 3. On WA there is a page, on which there are two buttons: ba and bb. The ba is linked to a script sa.php while bb linked to sb.php. Both the scripts are lcated on HA. The sa.php only talks with SA while sb.php talks with both SA and SB. So connection between sb.php and SB will have to go via Internet. 4. Sometimes both the scripts works well, when click on either ba or bb the scritps responce very quickly. But sometimes there may be problem with sb.php: when click on bb the WEB just stuck there and the small earth keep on rotating but nothing return. The most strange thing is that, if something wrong with sb.php, you cannot stop it. You click browser's stop button (it do looks stopped because the earth stopped) and then click ba (will call sa.php), still got nothing return, the browser seems not wake from sb.php's problem. I guess it might be something to do with MySQL connection via internet. But have no clue how to look into the problem. Could any one here can point me the right direction to get it fixed? Thanks in advance! Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]