...

View Full Version : Slight problem with PHP/MySQL



Digger3000
01-09-2006, 05:38 AM
I just installed Apache server because I think it might go faster. But when I load a page I get this:

"Fatal error: Call to undefined function mysql_connect() in C:\php5\PEAR\betaboard.php on line 556"

Velox Letum
01-09-2006, 05:44 AM
Open up php.ini and uncomment php_mysql.dll or whatever the MySQL extension name is.

Digger3000
01-09-2006, 05:45 AM
I found this: "extension=php_mysql.dll" but it doesn't seem to be commented.

Digger3000
01-10-2006, 12:04 AM
Is it possible Apache is looking for the PHP.ini somewhere else?

Element
01-10-2006, 12:05 AM
Too my knowledge, if PHP is doing anything at all, it is using the php.ini.

Digger3000
01-10-2006, 12:10 AM
Ok, it's using the php.ini that I put in the WINDOWS directory. But now when I start Apache it says the extensions "ext\php_mysql.dll" can't be found.

Digger3000
01-10-2006, 12:33 AM
Where should I put that dll "php_mysql.dll" so that Apache can find it.

Velox Letum
01-10-2006, 01:31 AM
Too my knowledge, if PHP is doing anything at all, it is using the php.ini.

Nay. If PHP isn't supplied with configuration values (or is missing some) it uses internal defaults.

Anyways, check that C:/php/ext/php_mysql.dll exists (or where ever PHP is). If not, I think you need to download an extension pack off php.net. If it does exist, use the full path (ie: C:/php/ext/php_mysql.dll).

Digger3000
01-10-2006, 01:36 AM
I'm 100% sure that C:\PHP\ext\php_mysql.dll exists, but it says it couldn't be found.

Velox Letum
01-10-2006, 01:48 AM
Try using the full path then. C:\PHP\ext\php_mysql.dll.

Digger3000
01-10-2006, 01:56 AM
You mean I should have this in php.ini: "extension=C:\PHP\ext\php_mysql.dll" I did that and when I start my apache server it says:

"PHP Startup: Unable to load dynamic library 'C:\PHP\ext\php_mysql.dll' - The specified module could not be found."

See? This is why I don't like Apache.

Velox Letum
01-10-2006, 02:22 AM
If it can't be found, then something is wrong with the path. It has absolutely nothing to do with Apache, it's PHP that can't find the extension. Verify your path.

Digger3000
01-10-2006, 02:28 AM
Ok I right clicked on the file and I'll copy and paste the information.

The filename is: "php_mysql.dll"
The location is: "C:\PHP\ext"

Is there any subtle difference between that and the path I stated?

Digger3000
01-10-2006, 02:55 AM
Ugh. I give up. This is why I stopped using Apache in the first place. It's so hard to deal with. I never have this problem with Abyss, so I'm going back to it. I don't care if my pages do take 5 seconds to load.

firepages
01-10-2006, 03:54 AM
Dont give up you are 1 copy away ~ the error is not that apache cant find the extension itself but that it can not find a required dll libmysql.dll

find libmysql.dll (it will either be in the PHP directory or PHP/EXT)
copy that to either
$C:/program files/apache/bin (e.g. the /bin directory for apache)
or $c:/windows/system32

I prefer to stick such bits in the /apache/bin directory but either will work.

Moving to Apache is a big step in the right direction (though that alone wont solve your aforementioned MySQL issues)

Digger3000
01-10-2006, 06:40 AM
I don't like Apache. It's slower than abyss, it's more complicated, harder to work with, and it crashes constantly.

firepages
01-10-2006, 07:23 AM
I don't like Apache. It's slower than abyss, it's more complicated, harder to work with, and it crashes constantly.

more complex & harder to work with , yes , until you get used to it (like anything)
slower , no , far from it.
crashes ... when you config is correct it wont crash unless you overload it with some infinate loop or recursive logic

...

It is (and this is the main reason you should get used to apache) the most common httpd server on the internet , it drives over 75% of ALL websites on the www

The chances are that you real webserver will be apache, using it locally helps make your code more portable since the server is the same at both ends.
Also whilst PHP runs on most webserver (& all that support CGI) most code examples a7 support topics assume the apache webserver.

If you only ever expect your work to run on win32 then use IIS instead, its a nightmare to administer but it is still the fastest platform for win32.

Digger3000
01-10-2006, 07:26 AM
I understand IIS is only on Windows XP Pro.

firepages
01-10-2006, 07:41 AM
thats correct, I think Home has PWS (at least it used to) but thats worse than anything :D

PS: there is nothing Wrong with Abyss as such , I have used it myself in the past , It just aint apache.

Velox Letum
01-10-2006, 09:19 AM
Word of advice: don't touch IIS, even while in an isolation suit and with a ten foot pole. You'll quickly be sucked into one of the numerous security holes.

On webservers, personally I like Apache and LiteSpeed Webserver. LiteSpeed has a few limits on the free (standard) version, and is only for Linux, but it's a pretty nice server if you ever get the chance to try it.

Digger3000
01-10-2006, 11:25 PM
I use the Abyss webserver. It's easy to set up, faster than Apache (from what I've seen.) It NEVER crashes, and it actually works.

Velox Letum
01-11-2006, 02:04 AM
I process 25 requests per second on Apache with no problem. There are faster servers, but those are usually enterprise solutions like Zeus.

blu3t00th
01-11-2006, 02:22 AM
i bet this will work it worked for me ;)

put this somewere in your httpd.conf file

PHPIniDir "C:/path/to/php/ini/"

and dont put the name just the path ;)

Digger3000
01-21-2006, 12:57 AM
i bet this will work it worked for me ;)

put this somewere in your httpd.conf file

PHPIniDir "C:/path/to/php/ini/"

and dont put the name just the path ;)
Put it where though?

Digger3000
01-21-2006, 01:11 AM
This is incredibly frustrating. Why can't it find php_mysql.dll when I tell it exactly where it is? It finds all the other extensions!

ralph l mayo
01-21-2006, 04:32 AM
Copy it to the same place all your other extensions are.

Digger3000
01-21-2006, 05:20 AM
It is in the same place all the other extensions are.

ralph l mayo
01-21-2006, 06:00 AM
Oh I see, it's an ini issue, maybe I should read the whole thread before responding next time :>. Try copying the php.ini with mysql line uncommented to c:\windows, then delete every other occurance of php.ini on your disk, and take out anything in httpd.conf pointing to a specific directory. So long as it's on the path it should get loaded, and it seems to me like it's loading a php.ini apart from the one you're editing.

Digger3000
01-21-2006, 06:07 AM
It doesn't seem like this issue is that it's commented, because if it were commented it wouldn't even try to load it. It is trying to load it, it just can't find it.

Velox Letum
01-21-2006, 07:41 AM
Are you sure its php_mysql.dll and not php_mysqli.dll that's in the directory? And it seems like its loading another php.ini to me too, run phpinfo(); (or phpinfo(1); for just that section) and check the path to php.ini from there.

Digger3000
01-21-2006, 08:06 AM
It says it's looking for php.ini in " C:\PHP\php.ini" which is the one I'm editing.

In C:\PHP\php.ini it says: extension_dir = "C:\PHP\ext"

It also says: "extension=php_mysql.dll"

And in "C:\PHP\ext" I have "php_mysql.dll"

I can't think of anything else to do. It seems like there's something really simple I'm forgetting to do but I can't think of anything.

firepages
01-21-2006, 09:16 AM
Dont give up you are 1 copy away ~ the error is not that apache cant find the extension itself but that it can not find a required dll libmysql.dll

find libmysql.dll (it will either be in the PHP directory or PHP/EXT)
copy that to either
$C:/program files/apache/bin (e.g. the /bin directory for apache)
or $c:/windows/system32

I prefer to stick such bits in the /apache/bin directory but either will work.

Moving to Apache is a big step in the right direction (though that alone wont solve your aforementioned MySQL issues)


did you try the above ?

Digger3000
01-21-2006, 06:24 PM
Ok, that worked. New question: What's the advantage of having Apache over Abyss? Apache now crashes every time I refresh a page.

Velox Letum
01-21-2006, 08:54 PM
If its crashing, its because you configured something incorrectly. Apache is community maintained, its powerful, and fast. You can get Apache to do just about anything.

firepages
01-22-2006, 04:01 AM
look in path/to/apache/log/error_log

That may or may not help you diagnose the problem, however if apache is really crashing then the errors may not get written but have a looksee anyway.

Digger3000
01-22-2006, 07:07 AM
Ok...does this mean anything to anyone:

"[Sat Jan 21 22:06:25 2006] [notice] Apache/2.0.55 (Win32) PHP/5.0.4 configured -- resuming normal operations
[Sat Jan 21 22:06:25 2006] [notice] Server built: Oct 9 2005 19:16:56
[Sat Jan 21 22:06:25 2006] [notice] Parent: Created child process 3492
[Sat Jan 21 22:06:25 2006] [notice] Child 3492: Child process is running
[Sat Jan 21 22:06:26 2006] [notice] Child 3492: Acquired the start mutex.
[Sat Jan 21 22:06:26 2006] [notice] Child 4328: Released the start mutex
[Sat Jan 21 22:06:26 2006] [notice] Child 3492: Starting 250 worker threads.
[Sat Jan 21 22:06:27 2006] [notice] Child 4328: Waiting for 250 worker threads to exit.
[Sat Jan 21 22:06:27 2006] [notice] Child 4328: All worker threads have exited.
[Sat Jan 21 22:06:27 2006] [notice] Child 4328: Child process is exiting
[Sat Jan 21 22:08:48 2006] [notice] Parent: Received shutdown signal -- Shutting down the server.
[Sat Jan 21 22:08:51 2006] [notice] Child 3492: Exit event signaled. Child process is ending.
[Sat Jan 21 22:08:57 2006] [notice] Parent: Child process exited successfully."



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum