Skip to Content.
Sympa Menu

freetds - Re: [freetds] successfully installed php/freetds on linux but...

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Daniel Fazekas <fdsubs AT axelero.hu>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] successfully installed php/freetds on linux but...
  • Date: Thu, 6 Nov 2003 18:48:45 +0100

On Nov 6, 2003, at 18:02, Henry Harvey wrote:
If I log in as root, and run a php
script with mssql_connect....
from the command line (php mssql-test.php)
it works very well.
If I log in not as root, it will say
undefined function mssql_connect().
But that user has all the paths to the
/usr/local/freetds directory already.
If I login as www (which apache runs as)
and run "php mssql-test.php" it works.
But when I go to the URL to access that
script, it still tells me undefined
function on the browser.
Any idea?

One or more of the following:

- multiple copies of php (you probably left an old version around alongside the new)
- different copies of php.ini (if you compiled mssql support for php as a module instead of built-in)
- failed to update the Apache module

1. Why the command-line php interpreter works for two of your accounts (root and www) and not your user is most probably because you have more copies of php installed in different places and you aren't running the same copy in all of them.

Log in as each, and type
which php

This will show where php is running from. You might have a copy in /usr/bin/php and /usr/local/bin/php as well.

2. To see if it's a problem with the ini file (again, multiple different copies being in use), run

php -i | grep php.ini

(Again test it in the different accounts.)

See if there is a difference. All should list the same configuration file (php.ini) path, and that file should have a line saying 'extension=mssql.so' in it if you compiled mssql support as a shared extension.
(By using ./configure --with-mssql=shared,/path/to/freetds)

If you didn't make a shared module, this could be ignored as you can't possibly not load the mssql extension..

3. Different behavior via the browser and from the command-line is not at all unusual, since the apache module SAPI of php and the command-line 'cli' SAPI of php are not the same and could have been built at a separate time with different options.

Are you sure you didn't forget specifying '--with-apxs' (for Apache 1.3.x) or '--with-apxs2' (for Apache 2) for php's ./configure script when you added mssql support?

Locate where libphp4.so is on your system and see if it's been correctly updated.

Try opening a <?php phpinfo(); ?> script via your browser and see if the configure command listed is the one where you added mssql support.

--
Daniel





Archive powered by MHonArc 2.6.24.

Top of Page