[mapguide-users] ODBC Support In PHP On Linux

larry white larz at neomatix.ca
Tue Oct 9 13:41:05 EDT 2007


I have added a few php extensions, including odbc and soap, to the
default linux mapguide 1.2 installation.


I apologize that some long lines have been wrapped by my email client.
please make note that everything contained with single quotes - ' ' - is
a single command line instruction.
Also, there is an assumption that you have a default installation of
unixODBC and the unixODBC dev packages. If you have these installed
elsewhere then pass that location into 'configure'

Please ensure you set the following variables or replace them with the
full path:
$path_to_mg_source_files
$path_to_mg_installed_files - probably /usr/local/mapguideopensource



Here are the steps i used to install odbc support

Firstly, build/install the linux webserver extensions in the 'LinuxApt'
dir. After building/installing, do the following

--------------------------------
'cd $path_to_mg_source_files/LinuxApt/php-5.2.1/ext/odbc'

'$path_to_mg_installed_files/webserverextensions/php/bin/phpize'

'./configure --with-unixODBC=/usr
--with-php-config=$path_to_mg_installed_files/webserverextensions/php/bin/php-config'

'make'

 (if all goes well)

'cp modules/odbc.so $path_to_mg_installed_files/webserverextensions/lib/'
--------------------------------


Then you must add a line to php.ini file to enable this odbc support
'$path_to_mg_installed_files/webserverextensions/php/lib/php.ini'

Search for the line containing 'extension=libphp_MapGuideApi.so' and add
the following line:
'extension=odbc.so'


To confirm that odbc support is enabled run:
--------------------------------
'$path_to_mg_installed_files/webserverextensions/php/bin/php -i|grep -i
odbc'
--------------------------------

You should see several lines, including the following at the beginning
--------------------------------
<h2><a name="module_odbc">odbc</a></h2>
<tr class="h"><th>ODBC Support</th><th>enabled</th></tr>
--------------------------------


Then restart apache
--------------------------------
'$path_to_mg_installed_files/webserverextensions/apache2/bin/apachectl
restart'
--------------------------------


Hope this helps.



larry white
Senior Systems Analyst
Neomatix Corporation
email: larz at neomatix.ca
url: www.neomatix.ca




Ismael Cams wrote:
> Hello James,
> 
> did you ever find a solution for this ?
> 
> I encountered the same problem. We have developed our application on a
> Windows environment and now want to migrate towards Linux, but as no ODBC
> support is included this is not possible. 
> 
> In my opinion it would be better to have some more libraries supported in
> the MapGuide PHP distribution by default. 
> 
> Ismaël



More information about the mapguide-users mailing list