[web] PHP4 & mcrypt -- no errors, but not loaded

Started by
2 comments, last by Sander 17 years, 10 months ago
I've just set up PHP4 and Apache 1.3 on a test server (to imitate our live web host). In php.ini, I uncommented out the "extension=php_mcrypt.dll" line. Apache started up fine. Now the problem: phpinfo() shows nothing about mcrypt actually being loaded, and I get undefined function errors whenever I try to use it. [Edit] I can't get Apache/PHP not to start up, no matter what I do to php.ini. I searched the entire hard drive for files named php.ini. There is only one. I erased the entire content of the file, and PHP still works without complaint. I deleted the php.ini file itself, and Apache still starts and parses PHP files fine. Just no extensions. WTF? I'm using Windows 2000 Server with Apache 1.3 and PHP 4 (latest versions of each). Anybody know what I could do to better diagnose the issue, or fix it? [Edited by - BeanDog on June 15, 2006 2:02:25 PM]
Advertisement
First of all, are you sure the php.ini file you are editing is the one that is loaded by PHP? You can check this with phpinfo(), it contains a 'Configuration File Path' in the first table.

Secondly, what is the variable 'extension_dir' in your php.ini set to? Try changing this value to an absolute path pointing your PHP '/extensions' dir (the dir that contains 'php_mcrypt.dll').

Try loading some other extension, like GD or bz2, and using one of it's functions. If you get errors with these too it's safe to assume the 'extension_dir' setting is not correct.
php.ini is by no means mandatory. In its absence, all defaults are used (unless overridden by web server settings).

If you run phpinfo() it will tell you the location of the php.ini it is using - BUT THAT MAY NOT EXIST. This is legal and relatively common.

Mark
Also, make sure PHP is compiled with mycrypt. If the mcrypt bindings are not in the binary (or in a separately loadable module) then switching the mcrypt directive on will do nothing, aside from maybe a complaint in an errorlog somewhere.

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

This topic is closed to new replies.

Advertisement