Hi,

I've recently installed Apache because I need features that Abyss (which I was using before) cannot handle.

PHP is working OK, but MySQL isn't. Scripts blow up at the mysql_connect() stage, i.e. the first MySQL call.

The correct php.ini file is picked up (according to phpinfo()) and this is one which worked in Abyss (and still does if I swap back to Abyss)

So, any help or suggestions?

It must be some Apache thing, but I haven't used Apache that much before - just set it up and left it.

Cheers,

Ian

    Gzornenplat;10989241 wrote:

    PHP is working OK, but MySQL isn't. Scripts blow up at the mysql_connect() stage, i.e. the first MySQL call.

    What does "blow up" mean? What is the exact error message or messages you're receiving? Do you have display_errors set to On and error_reporting set to E_ALL?

    Gzornenplat;10989241 wrote:

    The correct php.ini file is picked up (according to phpinfo()) and this is one which worked in Abyss (and still does if I swap back to Abyss)

    Have you tried making a change in that php.ini file, such as toggling display_errors On or Off, restarting Apache, and then doing another phpinfo() to verify that your change was reflected? (This is an easy way to ensure that PHP is reading your php.ini file.)

    If so, do you have the mysql extension enabled (i.e. uncommented) in that php.ini file?

    Also, which version of PHP are you using?

    Gzornenplat;10989241 wrote:

    So, any help or suggestions?

    Other than ensuring that PHP was properly installed (i.e. its main installation directory was added to your system's PATH environment variable, etc.), have you considered using something like [man]MySQLi[/man] instead? The [man]mysql[/man] extension is old and outdated, and new projects are advised to switch to MySQLi instead.

    Gzornenplat;10989241 wrote:

    It must be some Apache thing, but I haven't used Apache that much before - just set it up and left it.

    If your php.ini file is being read, then Apache plays no part in whether or not the mysql_* functions work in PHP.

      I've been playing around with this off and on.

      The error is: Call to undefined function mysql_connect()

      The correct ini file is getting picked up

      Apache error log shows

      PHP Warning: PHP Startup: Unable to load dynamic library 'D:\System\php\ext\php_curl.dll' - The specified module could not be found.\r\n in Unknown on line 0
      PHP Warning: PHP Startup: Unable to load dynamic library 'D:\System\php\ext\php_mcrypt.dll' - The specified module could not be found.\r\n in Unknown on line 0
      PHP Warning: PHP Startup: Unable to load dynamic library 'D:\System\php\ext\php_mysql.dll' - The specified module could not be found.\r\n in Unknown on line 0
      PHP Warning: PHP Startup: Unable to load dynamic library 'D:\System\php\ext\php_mysqli.dll' - The specified module could not be found.\r\n in Unknown on line 0

      But they are there, as demonstrated by it all working OK in Abyss as stated before - which also means that PHP is properly installed

        Fixed.

        Apparently PHP under Apache completely ignores the extension_dir directive it needs to be in your system's PATH - even copying the DLLs to System32 didn't work for me. Once added, you need to reboot the computer

          Gzornenplat wrote:

          Apparently PHP under Apache completely ignores the extension_dir directive it needs to be in your system's PATH - even copying the DLLs to System32 didn't work for me. Once added, you need to reboot the computer

          It works for me, e.g.,

          extension_dir = "C:/php5/ext"

            Also note that the extension directory itself shouldn't be in your system's PATH environment variable - just the main PHP installation folder.

              Write a Reply...