コマンドラインでCall to undefined function ftp_connect()
コマンドラインからftp_connect()がつかえなーい。
DSO(modules/libphp5.so)のほうでは使えるんだけど。なんで?
よくよくPHPマニュアル見たら、
PHP で FTP 関数を使用するには、PHP をインストールする際に --enable-ftp オプションを追加する必要があります。
どうやらcli版でftp関数使う場合には--enable-ftpつけてインストールするしかないっぽいのでやってみた。
前のconfigureの情報なんて忘れたよーと思ってたら、config.niceに書いてあった。
それに--enable-ftpを追加してやった。
ところでなんでオラクルのクライアントなんて入れてあるんだろうか。それさえ忘れた。。。
# cd /usr/local/src/php-5.2.3 # ./configure \ --prefix=/usr/local/php-5.2.3 \ --with-apxs2=/usr/local/apache2/bin/apxs \ --with-config-file-path=/etc \ --with-config-file-scan-dir=/etc/php.d \ --with-mysql=/usr/local/mysql \ --with-mysql-sock=/tmp/mysql.sock \ --with-mysqli=/usr/local/mysql/bin/mysql_config \ --with-pdo-mysql=/usr/local/mysql \ --with-curl=/usr \ --with-curlwrappers \ --enable-zip \ --with-zlib=/usr/ \ --with-zlib-dir=/usr/lib \ --with-bz2=/usr \ --with-libxml-dir=/usr \ --with-gd=/usr \ --with-jpeg-dir=/usr \ --with-png-dir=/usr \ --with-xpm-dir=/usr/X11R6 \ --with-freetype-dir=/usr \ --with-t1lib=/usr/local \ --enable-gd-native-ttf \ --enable-gd-jis-conv \ --enable-mbstring \ --with-mcrypt=/usr/local \ --with-xsl=/usr \ --enable-zend-multibyte \ '--with-oci8=instantclient,/usr/local/lib/instantclient_10_2' \ --enable-ftp # make; make install
これで使えたー。