[PHP-DB] Yet another Call to Undefined Function help request
Hi all, PLEASE, don't just toss the e-mail... I think I have a unique enough situation to warrant this e-mail. First, I have searched the mailing lists for the answer to my problem. I have also tried to find the answer through the documentation, but have been unsuccessful. Mailing lists are always my last resort. Here's the situation. I have an *old* Cobalt Raq appliance with Apache 1.3.20 and an older version of mysql on it. I have a customer that wants to use a database on his website, and rather than update this old, unsupported appliance and possibly break something, or go through the hassle of moving this customer with 100+ e-mail addresses to a different server, we have installed a new, dedicated mysql server to use system-wide for any of our customers, and ourselves, to use as a db server. This seemed like a good idea at the time, and I think it will work well once we figure out the bugs here. Now, everything was going swimmingly, until we tried to access the db with php on a web page (which is where we got the call to undefined function). It was an old version of php, so I thought I'd upgrade, not as scary as upgrading all three pieces of software. No resolution there. I compiled it with mysql support, but still get the undefined function error. Now, on the new db server, phpinfo reports a whole section on mysql. On this older server, there is no mysql section in phpinfo. I can log in and access the databases remotly from the Cobalt server using command line mysql; I would like to try this at cli using php but don't know how. I am obviously missing something and I can't find the answer anywhere, other than reinstall apache, mysql, and php, which is kind of scary on a server this old that is running as well as it is. Not only that, but my ego is kicking in here and I would really like to understand what the problem is rather than just reinstalling everything... That just seems too M$ to me. Any suggestions? Thanks, Alex -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Yet another Call to Undefined Function help request
OK, sounds good, what am I looking for? I don't see the module being declared in my php.ini file on either of my servers. Alex Fortuno, Adam wrote: Alex: It sounds like the MySQL extension module isn't loading. Here are some things to confirm: - Ensure the module is declared in your php.ini file - If it exists in the php.ini, confirm the module is located and named as stated in the php.ini file. - If the module is named and located in the proper place, check your permissions on that extension. You want to make sure whatever is running your sight can access the module. I hope this helps! A- -Original Message- From: Alex Moen [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 09, 2008 9:54 AM To: php-db@lists.php.net Subject: [PHP-DB] Yet another Call to Undefined Function help request Hi all, PLEASE, don't just toss the e-mail... I think I have a unique enough situation to warrant this e-mail. First, I have searched the mailing lists for the answer to my problem. I have also tried to find the answer through the documentation, but have been unsuccessful. Mailing lists are always my last resort. Here's the situation. I have an *old* Cobalt Raq appliance with Apache 1.3.20 and an older version of mysql on it. I have a customer that wants to use a database on his website, and rather than update this old, unsupported appliance and possibly break something, or go through the hassle of moving this customer with 100+ e-mail addresses to a different server, we have installed a new, dedicated mysql server to use system-wide for any of our customers, and ourselves, to use as a db server. This seemed like a good idea at the time, and I think it will work well once we figure out the bugs here. Now, everything was going swimmingly, until we tried to access the db with php on a web page (which is where we got the call to undefined function). It was an old version of php, so I thought I'd upgrade, not as scary as upgrading all three pieces of software. No resolution there. I compiled it with mysql support, but still get the undefined function error. Now, on the new db server, phpinfo reports a whole section on mysql. On this older server, there is no mysql section in phpinfo. I can log in and access the databases remotly from the Cobalt server using command line mysql; I would like to try this at cli using php but don't know how. I am obviously missing something and I can't find the answer anywhere, other than reinstall apache, mysql, and php, which is kind of scary on a server this old that is running as well as it is. Not only that, but my ego is kicking in here and I would really like to understand what the problem is rather than just reinstalling everything... That just seems too M$ to me. Any suggestions? Thanks, Alex -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Yet another Call to Undefined Function help request
On Tue, Dec 9, 2008 at 10:33 AM, Alex Moen [EMAIL PROTECTED] wrote: OK, sounds good, what am I looking for? I don't see the module being declared in my php.ini file on either of my servers. Alex Fortuno, Adam wrote: Alex: It sounds like the MySQL extension module isn't loading. Here are some things to confirm: - Ensure the module is declared in your php.ini file - If it exists in the php.ini, confirm the module is located and named as stated in the php.ini file. - If the module is named and located in the proper place, check your permissions on that extension. You want to make sure whatever is running your sight can access the module. I hope this helps! A- -Original Message- From: Alex Moen [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 09, 2008 9:54 AM To: php-db@lists.php.net Subject: [PHP-DB] Yet another Call to Undefined Function help request Hi all, PLEASE, don't just toss the e-mail... I think I have a unique enough situation to warrant this e-mail. First, I have searched the mailing lists for the answer to my problem. I have also tried to find the answer through the documentation, but have been unsuccessful. Mailing lists are always my last resort. Here's the situation. I have an *old* Cobalt Raq appliance with Apache 1.3.20 and an older version of mysql on it. I have a customer that wants to use a database on his website, and rather than update this old, unsupported appliance and possibly break something, or go through the hassle of moving this customer with 100+ e-mail addresses to a different server, we have installed a new, dedicated mysql server to use system-wide for any of our customers, and ourselves, to use as a db server. This seemed like a good idea at the time, and I think it will work well once we figure out the bugs here. Now, everything was going swimmingly, until we tried to access the db with php on a web page (which is where we got the call to undefined function). It was an old version of php, so I thought I'd upgrade, not as scary as upgrading all three pieces of software. No resolution there. I compiled it with mysql support, but still get the undefined function error. Now, on the new db server, phpinfo reports a whole section on mysql. On this older server, there is no mysql section in phpinfo. I can log in and access the databases remotly from the Cobalt server using command line mysql; I would like to try this at cli using php but don't know how. I am obviously missing something and I can't find the answer anywhere, other than reinstall apache, mysql, and php, which is kind of scary on a server this old that is running as well as it is. Not only that, but my ego is kicking in here and I would really like to understand what the problem is rather than just reinstalling everything... That just seems too M$ to me. Any suggestions? Thanks, Alex -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php In the new version of php, mysql is not enabled by default. Check the ini file for the modules section and ensure that the mysql is uncommented. -- Bastien Cat, the other other white meat
Re: [PHP-DB] Yet another Call to Undefined Function help request
GOT IT!!! Adam, thanks for the answer. It got me where I needed to be, and I now understand how this stuff works a little better. Here's the solution for future reference: The new server has a separate directory (/etc/php.d) that was referenced in the php.ini. (This server is running Fedora 9, btw.) In /etc/php.d was a file called mysql.ini, which had the line: extension=mysql.so I searched for extension in my php.ini file on the cobalt server, found, among other things: extension_dir = /usr/lib/apache/php ; directory in which the loadable extensions (modules) reside and ;UNIX Extensions ;extension=interbase.so ;extension=pgsql.so So, I added extension=mysql.so to the list. Then, I did a search for the mysql.so file, which turned out to be in the build/modules directory all by itself just waiting to be used, copied it to /usr/lib/apache/php/, restarted httpd, and voila, I now have a working implementation of php pulling data from a remote server. Thanks for the help!!! It is greatly appreciated! Alex Alex Moen wrote: OK, sounds good, what am I looking for? I don't see the module being declared in my php.ini file on either of my servers. Alex Fortuno, Adam wrote: Alex: It sounds like the MySQL extension module isn't loading. Here are some things to confirm: - Ensure the module is declared in your php.ini file - If it exists in the php.ini, confirm the module is located and named as stated in the php.ini file. - If the module is named and located in the proper place, check your permissions on that extension. You want to make sure whatever is running your sight can access the module. I hope this helps! A- -Original Message- From: Alex Moen [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 09, 2008 9:54 AM To: php-db@lists.php.net Subject: [PHP-DB] Yet another Call to Undefined Function help request Hi all, PLEASE, don't just toss the e-mail... I think I have a unique enough situation to warrant this e-mail. First, I have searched the mailing lists for the answer to my problem. I have also tried to find the answer through the documentation, but have been unsuccessful. Mailing lists are always my last resort. Here's the situation. I have an *old* Cobalt Raq appliance with Apache 1.3.20 and an older version of mysql on it. I have a customer that wants to use a database on his website, and rather than update this old, unsupported appliance and possibly break something, or go through the hassle of moving this customer with 100+ e-mail addresses to a different server, we have installed a new, dedicated mysql server to use system-wide for any of our customers, and ourselves, to use as a db server. This seemed like a good idea at the time, and I think it will work well once we figure out the bugs here. Now, everything was going swimmingly, until we tried to access the db with php on a web page (which is where we got the call to undefined function). It was an old version of php, so I thought I'd upgrade, not as scary as upgrading all three pieces of software. No resolution there. I compiled it with mysql support, but still get the undefined function error. Now, on the new db server, phpinfo reports a whole section on mysql. On this older server, there is no mysql section in phpinfo. I can log in and access the databases remotly from the Cobalt server using command line mysql; I would like to try this at cli using php but don't know how. I am obviously missing something and I can't find the answer anywhere, other than reinstall apache, mysql, and php, which is kind of scary on a server this old that is running as well as it is. Not only that, but my ego is kicking in here and I would really like to understand what the problem is rather than just reinstalling everything... That just seems too M$ to me. Any suggestions? Thanks, Alex -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: MS SQL error...I've come a long way to get this far
--- On Mon, 12/8/08, Fortuno, Adam [EMAIL PROTECTED] wrote: From: Fortuno, Adam [EMAIL PROTECTED] Subject: RE: [PHP-DB] Re: MS SQL error...I've come a long way to get this far To: [EMAIL PROTECTED] Date: Monday, December 8, 2008, 10:56 PM Fred, Hmm, that makes me think the extension didn't load. When you fire up a page with ?php php_info(); ? do you see the module's information? If it makes you feel any better, I'm working thru integration with Oracle, and I'm not fairing too much better. A- -Original Message- From: Fred Silsbee [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2008 5:53 PM To: Fortuno, Adam Subject: RE: [PHP-DB] Re: MS SQL error...I've come a long way to get this far --- On Mon, 12/8/08, Fortuno, Adam [EMAIL PROTECTED] wrote: From: Fortuno, Adam [EMAIL PROTECTED] Subject: RE: [PHP-DB] Re: MS SQL error...I've come a long way to get this far To: [EMAIL PROTECTED], php-db@lists.php.net Date: Monday, December 8, 2008, 9:26 PM Fred, If you're using integrated security (e.g., a domain account such as domain\bob), you won't supply a password. However, the sa account is a SQL login (v.s. a domain login). In that case, it would make sense that you supply a password. See the following page for some code to connect using integrated security: http://msdn.microsoft.com/en-us/library/cc296205(SQL.90).aspx See the following page for some code to connect using a SQL login: http://msdn.microsoft.com/en-us/library/cc296182(SQL.90).aspx If you're curious if this is even an authentication/permissions issue, try to login using a domain login. The login event will be recorded in the `Event Viewer`. If you're attempt isn't recorded, you've got a communication problem with the server instance. If it is recorded, you'll be able to tell what the problem is authenticating. Good luck, and let us know how it turns out. A- -Original Message- From: Fred Silsbee [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2008 3:30 PM To: php-db@lists.php.net Subject: [PHP-DB] Re: MS SQL error...I've come a long way to get this far I was just thinking about something I've never understood completely! mssql_connect($server, 'sa', 'PW'); presumes the server doesn't have all the permissions in spite of the fact that it has the password. The password I gave is the XP Prof login PW. Maybe some other PW. --- On Mon, 12/8/08, Fred Silsbee [EMAIL PROTECTED] wrote: From: Fred Silsbee [EMAIL PROTECTED] Subject: MS SQL error...I've come a long way to get this far To: php-db@lists.php.net Date: Monday, December 8, 2008, 7:13 PM many changes to php.ini to get this far..whew! PHP 5.2.7 just got jerked out from underneathe me (I have't replaced it since this is a simple script) phpinfo works! ?php // Server in the this format: computer\instance name or // server,port when using a non default port number $server = 'LANDON\SQLEXPRESS'; $link = mssql_connect($server, 'sa', 'PW'); line 6 if(!$link) { die('Something went wrong while connecting to MSSQL'); } ? Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: LANDON\SQLEXPRESS in C:\Inetpub\wwwroot\trymssql.php on line 6 Something went wrong while connecting to MSSQL -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php thanks! using the integrated server login code (first link you included, I get: Fatal error: Call to undefined function sqlsrv_connect() in C:\Inetpub\wwwroot\trymssql_1.php on line 7 still banging away meticulously loaded the new MS PHP upgrade update and still no luck -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: MS SQL error...I've come a long way to get this far
--- On Tue, 12/9/08, Fortuno, Adam [EMAIL PROTECTED] wrote: From: Fortuno, Adam [EMAIL PROTECTED] Subject: RE: [PHP-DB] Re: MS SQL error...I've come a long way to get this far To: [EMAIL PROTECTED] Date: Tuesday, December 9, 2008, 5:14 PM Sorry! I've been swamped today, and I needed to install the PHP module for SQL Server before I could respond. Fred integration with Oracle...Linux or Windows? Fred I've got the Linux Oracle 11g1/PHP 5.2.6/ and MySQL Fred connection down...I can email working code. Windows. I'm running PHP (in ISAPI mode) on IIS integrating with a 9i instance on a RedHat box. Fred When I run : Fred ?php Fred // Server in the this format: computer\instance name or Fred // server,port when using a non default port number Fred $server = 'LANDON\SQLEXPRESS'; Fred Fred $link = mssql_connect($server, 'sa', 'K^a_t^e_a_u_x_3141'); Fred Fred if(!$link) Fred { Fred die('Something went wrong while connecting to MSSQL'); Fred } Fred? Fred Fred I get Fred Fred Warning: mssql_connect() [function.mssql-connect]: Unable to connect Fred to server: LANDON\SQLEXPRESS in C:\Inetpub\wwwroot\trymssql.php on Fred line 6 Something went wrong while connecting to MSSQL I installed the PHP module for SQL Server 2005 this morning, and I updated my php.ini file then restarted IIS. I dumped the following into a page, and I ran it. $server = 'Babylon'; $uid = 'UserName'; $pwd = '[EMAIL PROTECTED]'; $connectionInfo = array(UID = $uid, PWD = $pwd); $link = sqlsrv_connect($server, $connectionInfo); if(!$link) { die('Something went wrong while connecting to MSSQL'); } It worked without a problem. I downloaded whatever B.S. module Microsoft had on their site, and here is what I added to my ini: My php.ini file includes: [SQL_Server_2005] extension=php_sqlsrv_ts.dll I'm trying a different function than you did. Give my script a try. A- THANKS I'll try it I downloaded the adventure works .msi file and successfully installed it but found no new tables in my SQL SERVER 2005. This is from Microsoft: ?php /* Specify the server and connection string attributes. */ $serverName = (local); $connectionInfo = array( Database=AdventureWorks); /* Connect using Windows Authentication. */ $conn = sqlsrv_connect( $serverName, $connectionInfo); if( $conn === false ) { echo Unable to connect./br; die( print_r( sqlsrv_errors(), true)); } /* Query SQL Server for the login of the user accessing the database. */ $tsql = SELECT CONVERT(varchar(32), SUSER_SNAME()); $stmt = sqlsrv_query( $conn, $tsql); if( $stmt === false ) { echo Error in executing query./br; die( print_r( sqlsrv_errors(), true)); } /* Retrieve and display the results of the query. */ $row = sqlsrv_fetch_array($stmt); echo User login: .$row[0]./br; /* Free statement and connection resources. */ sqlsrv_free_stmt( $stmt); sqlsrv_close( $conn); ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: MS SQL error...I've come a long way to get this far
--- On Tue, 12/9/08, Fortuno, Adam [EMAIL PROTECTED] wrote: From: Fortuno, Adam [EMAIL PROTECTED] Subject: RE: [PHP-DB] Re: MS SQL error...I've come a long way to get this far To: [EMAIL PROTECTED] Date: Tuesday, December 9, 2008, 5:14 PM Sorry! I've been swamped today, and I needed to install the PHP module for SQL Server before I could respond. Fred integration with Oracle...Linux or Windows? Fred I've got the Linux Oracle 11g1/PHP 5.2.6/ and MySQL Fred connection down...I can email working code. Windows. I'm running PHP (in ISAPI mode) on IIS integrating with a 9i instance on a RedHat box. Fred When I run : Fred ?php Fred // Server in the this format: computer\instance name or Fred // server,port when using a non default port number Fred $server = 'LANDON\SQLEXPRESS'; Fred Fred $link = mssql_connect($server, 'sa', 'K^a_t^e_a_u_x_3141'); Fred Fred if(!$link) Fred { Fred die('Something went wrong while connecting to MSSQL'); Fred } Fred? Fred Fred I get Fred Fred Warning: mssql_connect() [function.mssql-connect]: Unable to connect Fred to server: LANDON\SQLEXPRESS in C:\Inetpub\wwwroot\trymssql.php on Fred line 6 Something went wrong while connecting to MSSQL I installed the PHP module for SQL Server 2005 this morning, and I updated my php.ini file then restarted IIS. I dumped the following into a page, and I ran it. $server = 'Babylon'; $uid = 'UserName'; $pwd = '[EMAIL PROTECTED]'; $connectionInfo = array(UID = $uid, PWD = $pwd); $link = sqlsrv_connect($server, $connectionInfo); if(!$link) { die('Something went wrong while connecting to MSSQL'); } It worked without a problem. I downloaded whatever B.S. module Microsoft had on their site, and here is what I added to my ini: My php.ini file includes: [SQL_Server_2005] extension=php_sqlsrv_ts.dll I'm trying a different function than you did. Give my script a try. A- I've truly gotten lots of help from this forum/list I tried the following and got:Something went wrong while connecting to MSSQL ?php // Server in the this format: computer\instance name or // server,port when using a non default port number $server = 'LANDON\SQLEXPRESS'; //$server = '(local)\sqlexpress'; // $server = 'Babylon'; $uid = 'sa'; $pwd = 'xyxyxyxyx'; $connectionInfo = array(UID = $uid, PWD = $pwd); $link = sqlsrv_connect($server, $connectionInfo); if(!$link) { die('Something went wrong while connecting to MSSQL'); } ? I only have the 2nd statement of your: [SQL_Server_2005] extension=php_sqlsrv_ts.dll I'll try anything at this point! thanks again! I have added to my path both directories where I downloaded PHP files -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Yet another Call to Undefined Function help request
Then, I did a search for the mysql.so file, which turned out to be in the build/modules directory all by itself just waiting to be used, copied it to /usr/lib/apache/php/, restarted httpd, and voila, I now have a working implementation of php pulling data from a remote server. Did you run 'make install'? because that step is supposed to do that for you. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Yet another Call to Undefined Function help request
Yes, I did run make install... I was kind of surprised that it didn't put that file somewhere. Alex Chris wrote: Then, I did a search for the mysql.so file, which turned out to be in the build/modules directory all by itself just waiting to be used, copied it to /usr/lib/apache/php/, restarted httpd, and voila, I now have a working implementation of php pulling data from a remote server. Did you run 'make install'? because that step is supposed to do that for you. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: MS SQL error...I've come a long way to get this far
--- On Tue, 12/9/08, Fortuno, Adam [EMAIL PROTECTED] wrote: From: Fortuno, Adam [EMAIL PROTECTED] Subject: RE: [PHP-DB] Re: MS SQL error...I've come a long way to get this far To: [EMAIL PROTECTED] Date: Tuesday, December 9, 2008, 8:20 PM Fred, Have you checked the permissions on the extensions to make sure that the process running your site has access? Since you're able to call the function, I don't think this is the problem, but I'm running out of ideas. Also, are you seeing anything in SQL Server's error log or the event log, which might be helpful? You have SQL Server Native Client installed? I assume you've quadruple-checked the credentials? A- -Original Message- From: Fred Silsbee [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 09, 2008 1:39 PM To: Fortuno, Adam Cc: php-db@lists.php.net Subject: RE: [PHP-DB] Re: MS SQL error...I've come a long way to get this far --- On Tue, 12/9/08, Fortuno, Adam [EMAIL PROTECTED] wrote: From: Fortuno, Adam [EMAIL PROTECTED] Subject: RE: [PHP-DB] Re: MS SQL error...I've come a long way to get this far To: [EMAIL PROTECTED] Date: Tuesday, December 9, 2008, 5:14 PM Sorry! I've been swamped today, and I needed to install the PHP module for SQL Server before I could respond. Fred integration with Oracle...Linux or Windows? Fred I've got the Linux Oracle 11g1/PHP 5.2.6/ and MySQL Fred connection down...I can email working code. Windows. I'm running PHP (in ISAPI mode) on IIS integrating with a 9i instance on a RedHat box. Fred When I run : Fred ?php Fred // Server in the this format: computer\instance name or Fred // server,port when using a non default port number Fred $server = 'LANDON\SQLEXPRESS'; Fred Fred $link = mssql_connect($server, 'sa', 'K^a_t^e_a_u_x_3141'); Fred Fred if(!$link) Fred { Fred die('Something went wrong while connecting to MSSQL'); Fred } Fred? Fred Fred I get Fred Fred Warning: mssql_connect() [function.mssql-connect]: Unable to connect Fred to server: LANDON\SQLEXPRESS in C:\Inetpub\wwwroot\trymssql.php on Fred line 6 Something went wrong while connecting to MSSQL I installed the PHP module for SQL Server 2005 this morning, and I updated my php.ini file then restarted IIS. I dumped the following into a page, and I ran it. $server = 'Babylon'; $uid = 'UserName'; $pwd = '[EMAIL PROTECTED]'; $connectionInfo = array(UID = $uid, PWD = $pwd); $link = sqlsrv_connect($server, $connectionInfo); if(!$link) { die('Something went wrong while connecting to MSSQL'); } It worked without a problem. I downloaded whatever B.S. module Microsoft had on their site, and here is what I added to my ini: My php.ini file includes: [SQL_Server_2005] extension=php_sqlsrv_ts.dll I'm trying a different function than you did. Give my script a try. A- I've truly gotten lots of help from this forum/list I tried the following and got:Something went wrong while connecting to MSSQL ?php // Server in the this format: computer\instance name or // server,port when using a non default port number $server = 'LANDON\SQLEXPRESS'; //$server = '(local)\sqlexpress'; // $server = 'Babylon'; $uid = 'sa'; $pwd = 'xyxyxyxyx'; $connectionInfo = array(UID = $uid, PWD = $pwd); $link = sqlsrv_connect($server, $connectionInfo); if(!$link) { die('Something went wrong while connecting to MSSQL'); } ? I only have the 2nd statement of your: [SQL_Server_2005] extension=php_sqlsrv_ts.dll I'll try anything at this point! thanks again! I have added to my path both directories where I downloaded PHP files permissions sound viable...problem is that the only way I see permissions can be set is on directories Problem put on MSDN forum if you are interested: http://forums.microsoft.com/forums/ShowPost.aspx?PostID=4227666SiteID=1 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php