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=url&theme=classic&filter=RichyH&user=imajes&url=http%3A%2F%2Fphp.net%2F/" -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php