Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-07-25 05:14:05

HobbyTech
New Member
From: USA
Registered: 2006-07-25
Posts: 8

Can't Install, get "Call to undefined function mysql_connect()"

<pre>Windows XP Pro SP 2
Apache 2.0.58
PHP 5.1.2
MySQL 5.0.21</pre>

<pre>“Fatal error: Call to undefined function mysql_connect() in I:\htdocs\TxpSite\textpattern\setup\index.php on line 189”</pre>

<p>I don’t know why.</p>

<ul><li>I left the MySQL Server at “localhost”</li>
<li>Database is created, using correct DB name “TxpDB”</li>
<li>Using correct DB password</li>
<li>Using correct login name</li>
<li>Gave permissions on “TxpDb” to a user I’ll call “theUser”, with pw I’ll call “thePassword”:<br />
grant select,insert,update,delete,index,alter,create,drop on TxpDB.* to theUser identified by ‘thePassword’;</li>
<li>Site URL: “http://localhost/TxpSite”</li></ul>

<p>I also tried the Windows service name, “MySQL”, as the MySQL server, but I understand now from reading it is really supposed to be “localhost”, which I tried first.</p>

<p>I know there are no problems between PHP, MySQL, and Apache because I have several Apache test scripts that use MySQL with no problem. Apache runs under the “SYSTEM” account by default on Windows, and that’s the way it is on my machine.</p>

<p>I tried installing another blog software to see if maybe Textpattern is just difficult or something, but that one freezes while trying to connect to MySQL (on its own DB with its own user and password). I verified for both blog software packages that no tables have been created in their respective databases, so I think I’m totally missing something.</p>

<p>The “htdocs” folder is on a partition for all web stuff, while the servers are on my system partition. I created its own folder for each install, as you can see by the path “I:\htdocs\TxpSite\textpattern\setup\index.php” (which is the correct txp path). The <b>actual database files</b> are stored on a partition seperate from the MySQL server, and as I said, Apache/PHP/MySQL work fine with some test scripts…I’m just learning, but they do work.</p>

<p><b>What am I missing?</b></p>

Last edited by HobbyTech (2006-07-25 05:17:25)


Windows XP Pro SP2
Apache 2.0.58
PHP 5.1.2
MySQL 5.0.21

Offline

#2 2006-07-25 07:09:16

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Can't Install, get "Call to undefined function mysql_connect()"

Are you certain you have MySQL installed, not just MySQLi?

Offline

#3 2006-07-25 08:44:45

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Can't Install, get "Call to undefined function mysql_connect()"

Looks like you don’t have the PHP mysql extension installed. phpinfo() or php.exe -i should tell you.


Alex

Offline

#4 2006-07-26 01:57:44

HobbyTech
New Member
From: USA
Registered: 2006-07-25
Posts: 8

Re: Can't Install, get "Call to undefined function mysql_connect()"

Mary wrote:

Are you certain you have MySQL installed, not just MySQLi?

<p>Yes, I have MySQL installed…I created a database and password, as I said. I’m learning web development using Apache, PHP, and MySQL, done some basic stuff (like designing a database…with tables that are populated…and making a PHP script that queries and returns the result in an HTML page, some of it’s my own stuff not following the book).</p>

<p>So, <b>yes</b>, MySQL is <b>installed and working</b>! I just think I am missing some small detail in my setup because with both blog softwares, neither one can connect to MySQL at all. They each have their own database, username, and password.</p>

<p>I installed the 2nd one just to see if I have the same problem as the first one, and I do.</p>

<p><b>And, by the way, the blog software users are set to use localhost</b>…“localhost” (without quotes) is in the Host column in the User database of the mysql table.</p>


Windows XP Pro SP2
Apache 2.0.58
PHP 5.1.2
MySQL 5.0.21

Offline

#5 2006-07-26 02:05:38

HobbyTech
New Member
From: USA
Registered: 2006-07-25
Posts: 8

Re: Can't Install, get "Call to undefined function mysql_connect()"

zem wrote:

Looks like you don’t have the PHP mysql extension installed. phpinfo() or php.exe -i should tell you.

<p>I don’t see it…I assume you’re not talking about “mysql.sock”, since that is listed in the section “Mysqli”. I don’t know where I’d expect to see it (is it a module?), but it should be easy since each section’s details are listed alphabetically.</p>

<p>OK, so I’ll go to the PHP site and see how to fix this…I used the Windows installer, which is recommended, so I hope it’s not to hard to fix b/c I don’t have any experience with PHP or MySQL on Apache before buying these books.</p>

<p><br />
<b>———- EDIT ————-</b>
Ok, so I read the PHP docs, and MySQL is compiled into Windows already (THANK GOD!)…all I needed to do to enable it is uncomment “extension=php_mysql.dll” in “php.ini”. I restarted both MySQL and Apache (probably only needed to restart Apache), and there is now a whole section for “Mysql”.<br /><br />

Now, I just need to see if the install of either/both work(s).
<b>——————————-</b></p>

Last edited by HobbyTech (2006-07-26 02:41:27)


Windows XP Pro SP2
Apache 2.0.58
PHP 5.1.2
MySQL 5.0.21

Offline

#6 2006-07-26 02:13:30

hcgtv
Archived Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Re: Can't Install, get "Call to undefined function mysql_connect()"

In your php.ini are you sure this line is uncommented?

extension=php_mysql.dll

Offline

#7 2006-07-26 03:07:49

HobbyTech
New Member
From: USA
Registered: 2006-07-25
Posts: 8

Re: Can't Install, get "Call to undefined function mysql_connect()"

<p>Thanks, Burt…(and PHP manual-writers)…that was it. Maybe that info should be in the manual of the texpattern install, for people who used the Windows installer for PHP.</p>

<p>The PHP docs actually recommend a manual install. But I read somewhere else (maybe in the MySQL docs, or in someone’s comments to some docs…I don’t remember), that it is best to use the installer if you’re doing all 3, because it sets things up “right”, and there’s very little you need to change.</p>

<p>I can vouch for that, no problems on my first Apache/PHP/MySQL install ever (did install Apache before by itself, but didn’t do much with it).</p>

<p>Uncommenting “extension=php_mysql.dll” certainly qualifies as a very minor change…and I would have known it without asking if I was not a newbie at PHP. So I think using the installer is a good bet, assuming you’re not going to go “live” without changing security settings first. Don’t know if you agree, and maybe this is a little OT, except I think it’s really not OT b/c that note could be added to the “TextBook”</p>

<ul><li>If you compile PHP from source, must compile with mysql extension</li>
<li>If you use installer, which is binary, don’t use PHP 4.x b/c mysq extension is NOT compiled in</li>
<li>if you use installer:
<ul><li>use PHP 5.x b/c mysql extension IS compiled in</li>
<li>make sure your extension_dir is set in “php.ini”</li>
<li>make sure you uncomment “extension=php_mysql.dll” by removing the “;” at the beginning of the line (be real specific, in case newbies don’t know what “uncomment” means)</li></ul></li></ul>

<p><b>[CONSIDER THIS SOLVED]</b><br />
(Is this what we’re supposed to do if it’s solved? Some forums have you put [SOLVED] in the subject, but we can’t edit the subject here.)</p>

Last edited by HobbyTech (2006-07-26 03:09:08)


Windows XP Pro SP2
Apache 2.0.58
PHP 5.1.2
MySQL 5.0.21

Offline

#8 2006-07-30 04:42:03

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Can't Install, get "Call to undefined function mysql_connect()"

PHP has excellent documentation provided for it by the developers, why duplicate it? Particularly when, if you don’t know what you’re doing, there are several all-in one solutions available.

Offline

Board footer

Powered by FluxBB