Scodigo, Inc.

Log In | Register

Cart Items:
0

Enabling MySQL

I have enjoyed experimenting with the plugin and imagine the huge potential it offers. However I have been struggling to enable MySQL support in the plugin and have given up for the moment - I would be grateful for your help.

The output of get_loaded_extensions() or phpinfo() shows that mySQL is not running. Calling mysql functions result for example in:
"PHP Fatal error: Call to undefined function mysql_connect() in Embedded code on line 1"

Here are the relevant lines taken from running phpinfo(), using the plugin:
===
Configuration File (php.ini) Path => C:\Program Files\FileMaker\FileMaker Pro 8.5 Advanced\Extensions\PHP Support\php.ini
=
extension_dir => C:\Program Files\FileMaker\FileMaker Pro 8.5 Advanced\Extensions\PHP Support => C:\Program Files\FileMaker\FileMaker Pro 8.5 Advanced\Extensions\PHP Support
===

Here are the relevant line from the php.ini file referred to above:
===
extension_dir = "C:\Program Files\FileMaker\FileMaker Pro 8.5 Advanced\Extensions\PHP Support"
=
extension=php_mysql.dll
(ie - uncommented)
===

I have copied libmysql.dll and php_mysql.dll to \PHP Extensions (and quite a few other places too).

In case it could be relevant I already have PHP4 installed on this computer (which is compiled with MySQL support by default, unlike PHP5 which isn't).

Is there something I've overlooked? The PHP manual is a little unclear (to me):
>>XCVI MySQL Functions
Requirements
In order to have these functions available, you must compile PHP with MySQL support. <<
but later it explains how to enable it, similarly to your instructions.

I would appreciate any suggestions.

Tom Dupre

New test version

Micah Woods's picture

Hello Tom,

We have a new test version available which I think will solve your problem. I'm really excited because we've manage to compile the Windows version as a single plug-in file. This means you no longer have to install the separate php5ts.dll file. This also means that FileMaker's auto-update function for plug-ins can now be used.

This version also includes MySQL and Postgres compiled in, no need to load any extensions. And for MySQL we include both MySQL and MySQLi functions. We still need to do some additional testing before we release this version but you're welcome to download it and give it a try. If you do, please let me know if you have any issues.

http://www.scodigo.com/downloads/smartpill/test/PHP.fmx.zip

Regards,
Micah

MySQL now enabled

Great - I've installed the new .fmx file and it works beautifully, though there could perhaps be an issue (probably a PHP issue).

I tried a script to return rows from a database on a local version of MySQL - no problem. I simply changed the hostname from 'localhost' to the IP address of a remote web server - the results came back just as quickly. I changed the row count from the initial 10 - to 100, 1000 and so on.

It seemed more or less instant even when I returned all rows (over 11,000), so I wondered if the connection details had perhaps been cached and I was actually seeing local data. I put a space in the IP address and FileMaker crashed - I couldn't get back into the field to remove the space. I force-quitted and reopened - I was on the same record and again was stuck. I quitted again, opened another file, disabled the plugin, then opened the original file and fixed the problem.

I've tested this a little and sometimes a normal connection failure error message is generated. I expect it's a timeout issue. After numerous attempts to get MySQL working with the last plugin version I could have messed things up regarding the php.ini and other files I'm using, so this could be the reason, but I thought it worth mentioning.

Will the new fmx structure effect the ability to incorporate additional extensions?

Many thanks,
Tom

MySQL now enabled

Micah Woods's picture

Thanks for the info, we'll have to do some testing with larger data sets and remote databases.

Regarding the php.ini file (stored in the PHP Support folder), you may want to replace it with a new copy from our distribution and also keep in mind that the plug-in will run without it as well (it will use the default settings that we used when it was compiled).

I'd be very interested to know if you can reproduce the error you're getting. It would also be good to know if you're setting the second parameter for the PHP_Execute function (keepMemory) to 1 and if you made any changes to the timeout parameter?

As for using additional extensions, we haven't tested this but there should be no reason that this wouldn't work.

Regards,
Micah