mssql_connect not working from command line

mssql_connect not working from command line

am 11.09.2007 00:02:39 von Instruct ICC

I had cronjobs running fine on Linux which included a file which called
mssql_connect.

Today when I run the cronjob script directly from the command line, I get:
PHP Fatal error: Call to undefined function mssql_connect() in
/the/included/file.php on line #

Fatal error: Call to undefined function mssql_connect() in
/the/included/file.php on line #

I also notice that the cronjob started failing 1 month ago.

The file is owned by the command line user and apache is in its group and
vice versa.

However, a web page that includes the same file with the mssql_connect call
still works fine, and now it makes sense that I see mssql is still enabled
in phpinfo.

The admin says nothing changed.

Is there a setting that must have been changed to disallow this function
from working on the command line?

I'm using PHP Version 5.1.6 and /etc/php.ini has changed 2 months ago and
the cronjob worked since then.

____________________________________________________________ _____
Gear up for Halo® 3 with free downloads and an exclusive offer.
http://gethalo3gear.com?ocid=SeptemberWLHalo3_MSNHMTxt_1

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: mssql_connect not working from command line

am 11.09.2007 03:00:17 von dmagick

> However, a web page that includes the same file with the mssql_connect
> call still works fine, and now it makes sense that I see mssql is still
> enabled in phpinfo.

The apache version of the php.ini file is different to the cli version.
Make sure you are looking at the right one.

On debian I have two separate directories for each config -
/etc/php5/apache2/ and /etc/php5/cli/

Try this:

php -i | grep 'php.ini'

from the command line to work out which php.ini to look at.

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: mssql_connect not working from command line

am 11.09.2007 16:25:00 von Instruct ICC

>>However, a web page that includes the same file with the mssql_connect
>>call still works fine, and now it makes sense that I see mssql is still
>>enabled in phpinfo.
>
>The apache version of the php.ini file is different to the cli version.
>Make sure you are looking at the right one.
>
>On debian I have two separate directories for each config -
>/etc/php5/apache2/ and /etc/php5/cli/
>
>Try this:
>
>php -i | grep 'php.ini'
>
>from the command line to work out which php.ini to look at.

Both your command
php -i | grep 'php.ini'
and
find / -name php.ini 2>/dev/null
report the single /etc/php.ini

Is there something in php.ini that would:
1) Allow web pages to work with mssql_connect
2) Allow the command line to use other PHP functions
3) Disallow mssql_connect from a script run from the command line

____________________________________________________________ _____
Can you find the hidden words?  Take a break and play Seekadoo!
http://club.live.com/seekadoo.aspx?icid=seek_hotmailtextlink 1

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: mssql_connect not working from command line

am 12.09.2007 02:31:41 von dmagick

Instruct ICC wrote:
>>> However, a web page that includes the same file with the
>>> mssql_connect call still works fine, and now it makes sense that I
>>> see mssql is still enabled in phpinfo.
>>
>> The apache version of the php.ini file is different to the cli
>> version. Make sure you are looking at the right one.
>>
>> On debian I have two separate directories for each config -
>> /etc/php5/apache2/ and /etc/php5/cli/
>>
>> Try this:
>>
>> php -i | grep 'php.ini'
>>
>> from the command line to work out which php.ini to look at.
>
> Both your command
> php -i | grep 'php.ini'
> and
> find / -name php.ini 2>/dev/null
> report the single /etc/php.ini

Hmm. do a php -i and look for:

Configuration File (php.ini) Path =>

That will tell you where it's looking for the file.

Maybe you need to create that file (or just symlink it to the other one).

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: mssql_connect not working from command line

am 12.09.2007 22:52:53 von Instruct ICC

>From: Chris
>
>Instruct ICC wrote:
>>Both your command
>>php -i | grep 'php.ini'
>>and
>>find / -name php.ini 2>/dev/null
>>report the single /etc/php.ini
>
>Hmm. do a php -i and look for:
>
>Configuration File (php.ini) Path =>
>
>That will tell you where it's looking for the file.
>
>Maybe you need to create that file (or just symlink it to the other one).

I get
Configuration File (php.ini) Path => /etc/php.ini

You said something about 2 different configuration files. I'm just making
up this name, but do you have something like:
CLI_Configuration File (php.ini) Path => /etc/cli_php.ini
as well as:
Configuration File (php.ini) Path => /etc/php.ini

Then I could see having "CLI_Configuration File" exist and reference _some_
file.

____________________________________________________________ _____
Get a FREE small business Web site and more from Microsoft® Office Live!
http://clk.atdmt.com/MRT/go/aub0930003811mrt/direct/01/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: mssql_connect not working from command line

am 13.09.2007 02:37:52 von dmagick

Instruct ICC wrote:
>> From: Chris
>>
>> Instruct ICC wrote:
>>> Both your command
>>> php -i | grep 'php.ini'
>>> and
>>> find / -name php.ini 2>/dev/null
>>> report the single /etc/php.ini
>>
>> Hmm. do a php -i and look for:
>>
>> Configuration File (php.ini) Path =>
>>
>> That will tell you where it's looking for the file.
>>
>> Maybe you need to create that file (or just symlink it to the other one).
>
> I get
> Configuration File (php.ini) Path => /etc/php.ini

Hmm strange. Looks ok.

> You said something about 2 different configuration files. I'm just
> making up this name, but do you have something like:
> CLI_Configuration File (php.ini) Path => /etc/cli_php.ini
> as well as:
> Configuration File (php.ini) Path => /etc/php.ini

I use debian and it places them in different folders:
/etc/php5/apache2/php.ini
and
/etc/php5/cli/php.ini

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: mssql_connect not working from command line

am 13.09.2007 16:29:12 von Instruct ICC

>From: Chris
>Instruct ICC wrote:
>>You said something about 2 different configuration files. I'm just making
>>up this name, but do you have something like:
>>CLI_Configuration File (php.ini) Path => /etc/cli_php.ini
>>as well as:
>>Configuration File (php.ini) Path => /etc/php.ini
>
>I use debian and it places them in different folders:
>/etc/php5/apache2/php.ini
>and
>/etc/php5/cli/php.ini

cat /etc/redhat-release
Fedora Core release 6 (Zod)

dmesg | head
Linux version 2.6.20-1.2962.fc6 (brewbuilder@ls20-bc2-14.build.redhat.com)
(gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)) #1 SMP Tue Jun 19 19:27:14
EDT 2007

php -version
PHP 5.1.6 (cli) (built: May 9 2007 11:47:50)

The strange thing is that it used to work up until apparently Jul 31. And
the /etc/php.ini had been changed well before that (and had been working on
both web and cli).

1) A web page referencing mssql_connect works in a browser.
2) A cronjob (CLI) referencing mssql_connect which had been working now does
not work.
New Info:
3) Attempting to run the web page from the command line fails on at
mssql_connect.
4) A CLI script using file("The web page") actually works?!?!?!?!

____________________________________________________________ _____
Gear up for Halo® 3 with free downloads and an exclusive offer.
http://gethalo3gear.com?ocid=SeptemberWLHalo3_MSNHMTxt_1

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: mssql_connect not working from command line [RESOLVED]

am 19.10.2007 21:55:46 von Instruct ICC

--_3a3fb0a4-78c1-4ec1-85cc-35302440e6d0_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Thanks for informing me that CGI and CLI may use a different php.ini and th=
at they may be compiled differently.

The admin finally admitted that he ran a yum update which overwrote the man=
ually compiled CLI version.

The reason I missed it was that the build date of the latest CLI version wa=
s earlier than when the scripts broke.

____________________________________________________________ _____
Climb to the top of the charts!=A0 Play Star Shuffle:=A0 the word scramble =
challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=3Dstarshuffle_wl mailtextlink_oc=
t=

--_3a3fb0a4-78c1-4ec1-85cc-35302440e6d0_--