How to compile unix odbc on a cPanel server? On a cPanel server, the /scripts/easyapache script almost provides all the modules that are required to host the websites but the modules such as odbc has to be installed manually. You first have to install the devel packages for unixodbc, then add a line in rawopts file and rebuild Apache+PHP. That is it.
1. Install the UnixODBC devel packages:
yum install unixODBC unixODBC-devel
2. You now need to create a file “all_php5” to add a line to enable odbc so that apache build will pick it up from there. File all_php5 is for PHP5 and all_php4 is for PHP4.
pico /var/cpanel/easy/apache/rawopts/all_php5
3. Add the following line:
--with-unixODBC=/usr
4. Rebuild Apache/PHP using the “easyapache” script and the above file will be picked up automatically:
/scripts/easyapache
Once the compilation completes, you should have odbc module compiled with PHP. You can check the module either using a phpinfo() file OR through shell by executing:
php -i | grep odbc
October 30th, 2010 at 7:07 am
i want to connect excel to my website but do not have the idea how to connect exel in cpanel..i can do it in stand alone pc using odbc and java but how to do it in C panel
October 30th, 2010 at 8:45 am
If it need Java to connect to Excel, make sure your hosting provider supports it on the server your website is ON. Also how exactly you connect to Excel?
November 15th, 2010 at 8:08 pm
I think you need double dashes here:
-–with-unixODBC=/usr
November 17th, 2010 at 11:44 am
Hi Amer,
There were double dashes but the format of highlighted text was different. I set “PreFormatted” format for the highlighted text and you can see the double-dash now.
Thanks for pointing it out though. 🙂
February 8th, 2012 at 2:46 am
its not showing ODBC option in easyapache,
will it works after that also??
February 11th, 2012 at 6:24 am
Right, easyapache doesn’t provide the ODBC option, which is why this method has to be used for installing it.