[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
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...