[PHP-DEV] PHP with FTP support on a Raq4 Server

2002-10-25 Thread Chris Morrow
Hi People,

I am running PHP 4.1.2 on a Cobalt Raq4 server. I'm pretty new to Linux and
can't understand why the server has come preinstalled with 2 diffrent
versions of PHP. When I run phpinfo() from scripts on the site through my
browser it says PHP is installed as an Apache module, but when I run it from
the command line it still has the same version number but says its a CGI
install.

I'm trying to use the ftp_connect() function in a script that is run from
the command line, ie. the CGI version and everytime I run it it says 'Call
to undefined function ftp_connect()' yet when I run it through the browser
on my site which is running the same version of PHP just the Apache module
it works fine.

Does anyone know what causes this strange behaviour or what I can do to get
my ftp_connect() function working from the command line on a Raq4 server?

Thanks for any help.

Chris Morrow



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




Re: [PHP-DEV] PHP with FTP support on a Raq4 Server

2002-10-25 Thread Markus Fischer
On Fri, Oct 25, 2002 at 01:39:15PM +0100, Chris Morrow wrote : 
 Hi People,
 
 I am running PHP 4.1.2 on a Cobalt Raq4 server. I'm pretty new to Linux and
 can't understand why the server has come preinstalled with 2 diffrent
 versions of PHP. When I run phpinfo() from scripts on the site through my
 browser it says PHP is installed as an Apache module, but when I run it from
 the command line it still has the same version number but says its a CGI
 install.

That's because the the Apache module (as the name says) is an
module to Apache. You can't execute it directly from the
shell, it only works within Apache.

The CGI version on the other side works with stdin,stdout and
stderr in both within an Webserver and so also on the shell.

 I'm trying to use the ftp_connect() function in a script that is run from
 the command line, ie. the CGI version and everytime I run it it says 'Call
 to undefined function ftp_connect()' yet when I run it through the browser
 on my site which is running the same version of PHP just the Apache module
 it works fine.

Two possibilities:

1) The ftp extension is not compiled in, but a module
   The CGI version of PHP is using a different (or no)
   php.ini and thus hasn't loaded the ftp exetension.

   solution:

   use dl() or fix your php.ini


2) Your CGI is not compiled with ftp support and it's
compiled in into the apache version, thus it's not available
as a module.

solution 1: compile only the ftp extension, load it as
module (see 1 above)
solution 2:  recompile php


HTH, btw, this is the wrong list. You should ask such
question at [EMAIL PROTECTED]

-- 
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
$ grep docref_root php.ini
docref_root = 
http://landonize.it/?how=urltheme=classicfilter=RichyHuser=imajesurl=http%3A%2F%2Fphp.net%2F/;

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