php-general Digest 16 May 2013 08:43:41 -0000 Issue 8231

Topics (messages 321079 through 321081):

Re: undef func - any more clues ?
        321079 by: georg
        321080 by: Jim Lucas

Saving session to database
        321081 by: Lester Caine

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Thanks !

yum install php-odbc really did the trick.

Now Im stuck where connect gives an error in apache error_log
that it cannot find file /lib/libmimerodbc.so  which is evidently there
in exactly that place (as given in odbcini.ini for driver definition) !
A bit unexpected. (possibly an error in errorhandling ?, i.e. other cause)

/georg

----- Original Message ----- From: "Jim Lucas" <li...@cmsws.com>
To: "georg" <georg.chamb...@telia.com>
Cc: <a...@ashleysheridan.co.uk>; <php-gene...@lists.php.net>
Sent: Tuesday, May 14, 2013 3:25 AM
Subject: Re: [PHP] undef func - any more clues ?


On 05/12/2013 10:34 AM, georg wrote:
Hi
Im not really following, I have done:
pecl list-all ; but dont find anything that has to do with ODBC

so still stuck with Apache error log saying : no such function (or eqiv
speak) odbc_connect()
tnx
Georg


I am using a CentOS 6.4 system as a work station. So, with that said, the systems are similar, but still different enough that you need to make a few changes regarding the package names to get things working.

I also have Apache installed the I develop with. These are the steps that I performed, and the order I performed them in, to get odbc working at the CLI and with Apache.

Here first is an example of what I got when trying to call odbc_connect() without the proper packages installed from the CLI.

[root@jim ~]# php -r "odbc_connect();"
PHP Fatal error: Call to undefined function odbc_connect() in Command line code on line 1

Fatal error: Call to undefined function odbc_connect() in Command line code on line 1


Search for the correct package.
[root@jim ~]$ yum list php* | grep -i odbc
php-odbc.x86_64                      5.3.3-22.el6         base

Install found package... (change the package name if needed)
[root@jim ~]# yum install php-odbc

...

Total download size: 428 k
Installed size: 1.2 M
Is this ok [y/N]: y

...

Running Transaction
  Installing : unixODBC-2.2.14-12.el6_3.x86_64               1/2
  Installing : php-odbc-5.3.3-22.el6.x86_64                  2/2
  Verifying  : php-odbc-5.3.3-22.el6.x86_64                  1/2
  Verifying  : unixODBC-2.2.14-12.el6_3.x86_64               2/2

Installed:
  php-odbc.x86_64 0:5.3.3-22.el6

Dependency Installed:
  unixODBC.x86_64 0:2.2.14-12.el6_3

Complete!

Update your locate database
[root@jim ~]# updatedb

Search for the recently installed package
[root@jim ~]# locate odbc.so | grep php
/usr/lib64/php/modules/odbc.so
/usr/lib64/php/modules/pdo_odbc.so

Re-run the first test - ah it is found...
[root@jim ~]# php -r "odbc_connect();"
PHP Warning: odbc_connect() expects at least 3 parameters, 0 given in Command line code on line 1

Warning: odbc_connect() expects at least 3 parameters, 0 given in Command line code on line 1


Once you have this, you know that everything in place to get it working with Apache.

Now to test in the web server. This is what I received when I viewed my test script via Apache and my browser.

URL: http://localhost/odbc_test.php

Fatal error: Call to undefined function odbc_connect() in /var/www/html/odbc_test.php on line 3


Now, to get it working with Apache, all I had to do was restart the web server.

[root@jim html]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

Now, refreshing the above page gives me this.

Warning: odbc_connect() expects at least 3 parameters, 0 given in /var/www/html/odbc_test.php on line 3

So, it is now working.

Review my steps above, make sure you perform them as I did and you should be working when you are done.

Let us know if you need anything further.

--
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/

--- End Message ---
--- Begin Message ---
On 5/13/2013 11:32 PM, georg wrote:
Thanks !

yum install php-odbc really did the trick.

Now Im stuck where connect gives an error in apache error_log
that it cannot find file /lib/libmimerodbc.so  which is evidently there
in exactly that place (as given in odbcini.ini for driver definition) !
A bit unexpected. (possibly an error in errorhandling ?, i.e. other cause)

So, the file /lib/libmimerodbc.so exists? If it does and Apache cannot access it, then it might be permissions. Make sure it is readable by httpd. And that your httpd is not setup in a chroot environment.


/georg

----- Original Message ----- From: "Jim Lucas" <li...@cmsws.com>
To: "georg" <georg.chamb...@telia.com>
Cc: <a...@ashleysheridan.co.uk>; <php-gene...@lists.php.net>
Sent: Tuesday, May 14, 2013 3:25 AM
Subject: Re: [PHP] undef func - any more clues ?


On 05/12/2013 10:34 AM, georg wrote:
Hi
Im not really following, I have done:
pecl list-all ; but dont find anything that has to do with ODBC

so still stuck with Apache error log saying : no such function (or eqiv
speak) odbc_connect()
tnx
Georg


I am using a CentOS 6.4 system as a work station.  So, with that said,
the systems are similar, but still different enough that you need to
make a few changes regarding the package names to get things working.

I also have Apache installed the I develop with.  These are the steps
that I performed, and the order I performed them in, to get odbc
working at the CLI and with Apache.

Here first is an example of what I got when trying to call
odbc_connect() without the proper packages installed from the CLI.

[root@jim ~]# php -r "odbc_connect();"
PHP Fatal error:  Call to undefined function odbc_connect() in Command
line code on line 1

Fatal error: Call to undefined function odbc_connect() in Command line
code on line 1


Search for the correct package.
[root@jim ~]$ yum list php* | grep -i odbc
php-odbc.x86_64                      5.3.3-22.el6         base

Install found package... (change the package name if needed)
[root@jim ~]# yum install php-odbc

...

Total download size: 428 k
Installed size: 1.2 M
Is this ok [y/N]: y

...

Running Transaction
  Installing : unixODBC-2.2.14-12.el6_3.x86_64               1/2
  Installing : php-odbc-5.3.3-22.el6.x86_64                  2/2
  Verifying  : php-odbc-5.3.3-22.el6.x86_64                  1/2
  Verifying  : unixODBC-2.2.14-12.el6_3.x86_64               2/2

Installed:
  php-odbc.x86_64 0:5.3.3-22.el6

Dependency Installed:
  unixODBC.x86_64 0:2.2.14-12.el6_3

Complete!

Update your locate database
[root@jim ~]# updatedb

Search for the recently installed package
[root@jim ~]# locate odbc.so | grep php
/usr/lib64/php/modules/odbc.so
/usr/lib64/php/modules/pdo_odbc.so

Re-run the first test - ah it is found...
[root@jim ~]# php -r "odbc_connect();"
PHP Warning:  odbc_connect() expects at least 3 parameters, 0 given in
Command line code on line 1

Warning: odbc_connect() expects at least 3 parameters, 0 given in
Command line code on line 1


Once you have this, you know that everything in place to get it
working with Apache.

Now to test in the web server.  This is what I received when I viewed
my test script via Apache and my browser.

URL: http://localhost/odbc_test.php

Fatal error: Call to undefined function odbc_connect() in
/var/www/html/odbc_test.php on line 3


Now, to get it working with Apache, all I had to do was restart the
web server.

[root@jim html]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

Now, refreshing the above page gives me this.

Warning: odbc_connect() expects at least 3 parameters, 0 given in
/var/www/html/odbc_test.php on line 3

So, it is now working.

Review my steps above, make sure you perform them as I did and you
should be working when you are done.

Let us know if you need anything further.

--
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/


--- End Message ---
--- Begin Message ---
I'm having a problem with webtrees ... http://webtrees.net/
My copy is running on http://webtrees.lsces.org.uk and you will see that it is throwing an error relating to the session handling.

Running Apache 2.2.22, PHP5.4.14, MySQL 5.5.31 ( 
http://lsces.org.uk/phpinfo.php )

If I comment out the session_set_save_handler() section of session.php then I can log in and use the site. Have tried reworking that as a SessionHandlerInterface without any success. As far as I can see, the 'write' function of the handler is not being called and while there are various notes about problems with PHP5.4 blocking access to the write and close functions, none of the fixes I have tried have resulted in a working setup.

Anybody seen this problem with PHP5.4?

http://lsces.org.uk/hg/webtrees/file/dcf6ff358108/includes/session.php#l334 is the code that seems to be failing.

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

--- End Message ---

Reply via email to