Instale o PHP como CGI e CLI

1

Estou tentando configurar o ambiente de desenvolvimento para alguns projetos antigos no PHP 5.1.4. Ele precisa ser executado como CGI (ou fastcgi) sob o apache e eu gostaria de ter o cli binary. Minhas opções de configuração são:

./configure \
--prefix=/usr/local/php-dev \
--with-config-file-path=/usr/local/php-dev/etc \
--enable-bcmath \
--enable-calendar \
--enable-dbase \
--enable-exif \
--enable-fastcgi \
--enable-force-cgi-redirect \
--enable-ftp \
--enable-gd-native-ttf \
--enable-mbstring \
--enable-memory-limit \
--enable-soap \
--enable-track-vars \
--enable-trans-sid \
--enable-versioning \
--enable-xslt \
--with-curl=/usr/local/php-libs/curl-7.12.2 \
--with-freetype \
--with-freetype-dir \
--with-gd \
--with-iconv \
--with-jpeg-dir \
--with-mhash \
--with-mime-magic \
--with-mssql=/usr/local/php-libs/freetds-0.64 \
--with-mysql=/usr/local/mysql5 \
--with-mysql-sock=/var/run/mysql/mysql.sock \
--with-openssl \
--with-pdo-mysql=/usr/local/mysql5 \
--with-pear \
--with-ttf \
--with-xslt-sablot=/usr/local/sablot-1.0.3 \
--with-zlib

Depois de instalá-lo, só tenho esses arquivos em /usr/local/php-dev/bin :

pear
peardev
pecl
php
php-config
phpize

Eu também esperaria php-cgi ou php-cli . Ao executar ./php -v da linha de comando, ele mostra:

PHP 5.1.4 (cgi-fcgi) (built: Sep 23 2010 09:46:33)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
 with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans

Portanto, só tenho a versão CGI e, quando tento executar scripts específicos da CLI, as variáveis $argv e $argc são NULL .

Existe uma maneira de ter as versões CLI e CGI? (sistema: slackware 13.0)

    
por dev-null-dweller 24.09.2010 / 11:30

1 resposta

2

De link :

The name, location and existence of the CLI/CGI binaries will differ depending on how PHP is installed on your system. By default when executing make, both the CGI and CLI are built and placed as sapi/cgi/php-cgi and sapi/cli/php respectively, in your PHP source directory. You will note that both are named php. What happens during make install depends on your configure line. If a module SAPI is chosen during configure, such as apxs, or the --disable-cgi option is used, the CLI is copied to {PREFIX}/bin/php during make install otherwise the CGI is placed there. So, for example, if --with--apxs is in your configure line then the CLI is copied to {PREFIX}/bin/php during make install. If you want to override the installation of the CGI binary, use make install-cli after make install. Alternatively you can specify --disable-cgi in your configure line.

Então, você tentou make install-cli ? Você tem um sapi dir com esses dois?

    
por 24.09.2010 / 14:22