Welcome Guest. Please Login or Register  


You are here: Index > AMPPS > General Support > Topic : PHP 5.3 with pdo_odbc & odbc

1


Threaded Mode | Print  

 PHP 5.3 with pdo_odbc & odbc, pdo_odbc not loaded (17 Replies, Read 71482 times)
FryShadow
Group: Member
Post Group: Newbie
Posts: 11
Status:
Hi,

I've try to add pdo_odbc.so extension which I've compile from the source. When I open 'PHP Extension" from the control panel, there's pdo_odbc. When I tick, restart Apache and looking at php_info there's no pdo_odbc loaded.

Anyone have done this before ? 
IP: --   

PHP 5.3 with pdo_odbc & odbc
Brijesh
Group: Softaculous Team
Post Group: Super Member
Posts: 3552
Status:
Hi,

Sir are you referring to Webuzo ?

-----------------------
SitePad Website Builder
Follow us on Twitter
IP: --   

PHP 5.3 with pdo_odbc & odbc
FryShadow
Group: Member
Post Group: Newbie
Posts: 11
Status:
hi,

This is for latest ampps
IP: --   

PHP 5.3 with pdo_odbc & odbc
tidus
Group: Member
Post Group: Super Member
Posts: 1123
Status:
Quote From : FryShadow September 16, 2012, 3:06 am
Hi,

I've try to add pdo_odbc.so extension which I've compile from the source. When I open 'PHP Extension" from the control panel, there's pdo_odbc. When I tick, restart Apache and looking at php_info there's no pdo_odbc loaded.

Anyone have done this before ? 
Hi,

Last line of the php.ini should look like

Code
extension=pdo_odbc.so
Can you see the extension loaded in phpinfo ? http://localhost/ampps/index.php?act=phpinfo

If its not loaded can you open a ticket ? We will look into it.

-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

PHP 5.3 with pdo_odbc & odbc
FryShadow
Group: Member
Post Group: Newbie
Posts: 11
Status:
Hi,

Step that I've done :

I'm on Mac OS X 10.7.4

1) Download latest PHP 5.3.16 from php.net
2) Install unixODBC
3) cd to php-5.3.16/ext/pdo_odbc
4) phpize , ./configure --with-pdo-odbc=unixODBC , make
5) Copy the pdo_odbc.so
6) Edit the php.ini

extension_dir = "{$path}/php-5.3/lib/extensions/ext/"
extension=pdo_odbc.so

7) Restart Apache, but no pdo_odbc loaded.

If there anything step that I miss ?

Thanks in advance.
IP: --   

PHP 5.3 with pdo_odbc & odbc
tidus
Group: Member
Post Group: Super Member
Posts: 1123
Status:
Quote From : FryShadow September 17, 2012, 6:11 am
Hi,

Step that I've done :

I'm on Mac OS X 10.7.4

1) Download latest PHP 5.3.16 from php.net
2) Install unixODBC
3) cd to php-5.3.16/ext/pdo_odbc
4) phpize , ./configure --with-pdo-odbc=unixODBC , make
5) Copy the pdo_odbc.so
6) Edit the php.ini

extension_dir = "{$path}/php-5.3/lib/extensions/ext/"
extension=pdo_odbc.so

7) Restart Apache, but no pdo_odbc loaded.

If there anything step that I miss ?

Thanks in advance.
Hi,

Yes. The steps are right.

Just make sure two things :
1. PHP 5.3 is enabled in AMPPS.
2. Correct php.ini is loaded.
Both can be confirmed in phpinfo.

After copying the extension in extensions directory "{$path}/php-5.3/lib/extensions/ext/", "PHP Extension" in AMPPS Application should be able to read the extension. Check it and Apply. This will change your php.ini. Restart Apache.

Note : Don't do any changes in /Applications/AMPPS/php/etc/php.ini directly. AMPPS will overwrite it with its /Applications/AMPPS/conf/php-5.3.ini

To test, run the following command in Terminal :
Code
/Applications/AMPPS/php/bin/php -c /Applications/AMPPS/php/etc/php.ini -m
If everything went fine, extension can be see in the output. OR the warning will appear that this extension was not able to load.

-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

PHP 5.3 with pdo_odbc & odbc
FryShadow
Group: Member
Post Group: Newbie
Posts: 11
Status:
Hi,

I've try to run :

Code
/Applications/AMPPS/php/bin/php
And found some error :

Code
Warning: PHP Startup: Unable to load dynamic library '/Applications/AMPPS/php-5.3/lib/extensions/ext/pdo_odbc.so' - dlopen(/Applications/AMPPS/php-5.3/lib/extensions/ext/pdo_odbc.so, 9): no suitable image found.  Did find:
    /Applications/AMPPS/php-5.3/lib/extensions/ext/pdo_odbc.so: mach-o, but wrong architecture in Unknown on line 0
IP: --   

PHP 5.3 with pdo_odbc & odbc
FryShadow
Group: Member
Post Group: Newbie
Posts: 11
Status:
Hi,

From the AMMPS control panel

Board Image
IP: --   

PHP 5.3 with pdo_odbc & odbc
tidus
Group: Member
Post Group: Super Member
Posts: 1123
Status:
Quote From : FryShadow September 17, 2012, 6:41 am
Hi,

I've try to run :

Code
/Applications/AMPPS/php/bin/php
And found some error :

Code
Warning: PHP Startup: Unable to load dynamic library '/Applications/AMPPS/php-5.3/lib/extensions/ext/pdo_odbc.so' - dlopen(/Applications/AMPPS/php-5.3/lib/extensions/ext/pdo_odbc.so, 9): no suitable image found.  Did find:
    /Applications/AMPPS/php-5.3/lib/extensions/ext/pdo_odbc.so: mach-o, but wrong architecture in Unknown on line 0

Hi,

AMPPS is trying to load it correctly. Looks like something went wrong in the compilation.

After phpize, can you give me the output of

Code
./configure --help


-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

PHP 5.3 with pdo_odbc & odbc
FryShadow
Group: Member
Post Group: Newbie
Posts: 11
Status:
Hi,

Code
$pwd
/Downloads/php-5.3.16/ext/pdo_odbc
Code
$ sudo ./configure --help
`configure' configures this package to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version          display version information and exit
  -q, --quiet, --silent  do not print `checking ...' messages
      --cache-file=FILE  cache test results in FILE [disabled]  -C, --config-cache      alias for `--cache-file=config.cache'
  -n, --no-create        do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or `..']

Installation directories:
  --prefix=PREFIX        install architecture-independent files in PREFIX
                          [/usr/local]
  --exec-prefix=EPREFIX  install architecture-dependent files in EPREFIX
                          [PREFIX]

By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc.  You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
  --bindir=DIR            user executables [EPREFIX/bin]
  --sbindir=DIR          system admin executables [EPREFIX/sbin]
  --libexecdir=DIR        program executables [EPREFIX/libexec]
  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
  --libdir=DIR            object code libraries [EPREFIX/lib]
  --includedir=DIR        C header files [PREFIX/include]
  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
  --infodir=DIR          info documentation [DATAROOTDIR/info]
  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
  --mandir=DIR            man documentation [DATAROOTDIR/man]
  --docdir=DIR            documentation root [DATAROOTDIR/doc/PACKAGE]
  --htmldir=DIR          html documentation [DOCDIR]
  --dvidir=DIR            dvi documentation [DOCDIR]
  --pdfdir=DIR            pdf documentation [DOCDIR]
  --psdir=DIR            ps documentation [DOCDIR]

System types:
  --build=BUILD    configure for building on BUILD [guessed]
  --host=HOST      cross-compile to build programs to run on HOST [BUILD]
  --target=TARGET  configure for building compilers for TARGET [HOST]

Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE      do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --enable-shared=PKGS  build shared libraries default=yes
  --enable-static=PKGS  build static libraries default=yes
  --enable-fast-install=PKGS  optimize for fast installation default=yes
  --disable-libtool-lock  avoid locking (might break parallel builds)

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE      do not use PACKAGE (same as --with-PACKAGE=no)
  --with-libdir=NAME      Look for libraries in .../NAME rather than .../lib
  --with-php-config=PATH  Path to php-config php-config
  --with-pdo-odbc=flavour,dir
                            PDO: Support for 'flavour' ODBC driver.
                            include and lib dirs are looked for under 'dir'.

                            'flavour' can be one of:  ibm-db2, iODBC, unixODBC, generic
                            If ',dir' part is omitted, default for the flavour
                            you have selected will used. e.g.:

                              --with-pdo-odbc=unixODBC

                            will check for unixODBC under /usr/local. You may attempt
                            to use an otherwise unsupported driver using the \"generic\"
                            flavour.  The syntax for generic ODBC support is:

                              --with-pdo-odbc=generic,dir,libname,ldflags,cflags

                            When build as shared the extension filename is always pdo_odbc.so
  --with-gnu-ld          assume the C compiler uses GNU ld default=no
  --with-pic              try to use only PIC/non-PIC objects default=use both
  --with-tags=TAGS      include additional configurations automatic


Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS    linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  LIBS        libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>
  CPP        C preprocessor

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

Report bugs to the package provider.


IP: --   

PHP 5.3 with pdo_odbc & odbc
FryShadow
Group: Member
Post Group: Newbie
Posts: 11
Status:
Hi,

More information. I'm coming from MAMP stack which I think make the build conflict :

Code
$ sudo make test

Build complete.
Don't forget to run 'make test'.


=====================================================================
PHP        : /Applications/MAMP/bin/php/php5.3.6/bin/php
PHP_SAPI    : cli
PHP_VERSION : 5.3.6
ZEND_VERSION: 2.3.0
PHP_OS      : Darwin - Darwin Mohds-MacBook-Pro.local 11.4.0 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64 x86_64
INI actual  : /Users/fryshadow/Downloads/php-5.3.16/ext/pdo_odbc/tmp-php.ini
More .INIs  : 
CWD        : /Users/fryshadow/Downloads/php-5.3.16/ext/pdo_odbc
Extra dirs  :
VALGRIND    : Not used
=====================================================================
TIME START 2012-09-17 14:59:26
=====================================================================
TEST 1/2 [tests/common.phpt]Warning: opendir(ext/pdo/tests): failed to open dir: No such file or directory in /Users/fryshadow/Downloads/php-5.3.16/ext/pdo_odbc/run-tests.php on line 850
ERROR: cannot open directory: ext/pdo/tests
IP: --   

PHP 5.3 with pdo_odbc & odbc
tidus
Group: Member
Post Group: Super Member
Posts: 1123
Status:
Hi,

I don't think MAMP will conflict.

Try this command to configure :
Code
LDFLAGS=-L/Applications/AMPPS/extra/lib CPPFLAGS=-I/Applications/AMPPS/extra/include ./configure --with-php-config=/Applications/AMPPS/php/bin/php-config-5.3.16 --with-pdo-odbc=unixODBC
Note : I am assuming you have unixODBC in /usr/local. Right ?

If not follow :
http://www.unixodbc.org/download.html

-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

PHP 5.3 with pdo_odbc & odbc
FryShadow
Group: Member
Post Group: Newbie
Posts: 11
Status:
Hi,

I've tried everything, but still stuck in :

Code
HP Warning:  PHP Startup: Unable to load dynamic library '/Applications/AMPPS/php-5.3/lib/extensions/ext/pdo_odbc.so' - dlopen(/Applications/AMPPS/php-5.3/lib/extensions/ext/pdo_odbc.so, 9): no suitable image found.  Did find:
    /Applications/AMPPS/php-5.3/lib/extensions/ext/pdo_odbc.so: mach-o, but wrong architecture in Unknown on line 0
Need a coffee here :)
IP: --   

PHP 5.3 with pdo_odbc & odbc
tidus
Group: Member
Post Group: Super Member
Posts: 1123
Status:
Hi,

Do you have lipo command ?

Can you find the arch of the .so file which was just created.

Code
lipo -info path/to/php-odbc.so


-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

PHP 5.3 with pdo_odbc & odbc
FryShadow
Group: Member
Post Group: Newbie
Posts: 11
Status:
Hi,

Yes, lipo is here.

Code
$ lipo -info pdo_mysql.so
Non-fat file: pdo_mysql.so is architecture: i386
$ lipo -info pdo_odbc.so
Non-fat file: pdo_odbc.so is architecture: x86_64

Is that the problem ?

But my arch is :

uname -a
Darwin local 11.4.0 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64 x86_64

IP: --   

« Previous    Next »

Threaded Mode | Print  

1


Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is September 24, 2017, 4:58 am.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 11  |  Page Created In:0.738