php命令行在安装后没有响应

I successfully compiled PHP 5.4.30 from source on centos5.5. But commands like ./php -v ./php -m will not return any output. Neither will ./php -f file.php command. In fact, only ./php --help generates output.

I have installed php.5.5.20 and php.5.4.36 with the same poor results.

php.5.3.x works and will generate output.

All the installations use the following ./configure options:

sudo   ./configure --prefix=/usr/local/newco \
            --with-openssl=/usr/local/ssl \
            --with-openssl-dir=/usr/local/ssl \
            --with-zlib-dir=/usr/local \
            --with-libxml-dir=/usr/local/newco \
            --with-curl=/usr/lib \
            --with-apxs2=/usr/local/newco/httpd/bin/apxs \
            --with-mysql \
            --with-mysqli=mysqlnd \
            --enable-embedded-mysqli \
            --enable-sigchild \
            --enable-mbstring=yes \
            --enable-debug=no \
            --enable-soap  \
            --with-pdo-mysql

PHP is running OK for all Apache requests.

$ ./php-config

Options:
  --prefix            [/usr/local/newco]
  --includes          [-I/usr/local/newco/include/php -I/usr/local/newco/include/php/main -I/usr/local/newco/include/php/TSRM -I/usr/local/newco/include/php/Zend -I/usr/local/newco/include/php/ext -I/usr/local/newco/include/php/ext/date/lib]
  --ldflags           [ -L/usr/local/newco/lib -L/usr/local/lib -L/usr/local/ssl/lib -L/usr/kerberos/lib]
  --libs              [-lcrypt   -lcrypt -lreadline -lncurses -lrt -lcurl -lz -lcrypto -lssl -lcrypto -lrt -lm -ldl -lnsl  -lxml2 -lz -lm -lcurl -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt ]
  --extension-dir     [/usr/local/newco/lib/php/extensions/no-debug-non-zts-20100525]
  --include-dir       [/usr/local/newco/include/php]
  --man-dir           [/usr/local/newco/php/man]
  --php-binary        [/usr/local/newco/bin/php]
  --php-sapis         [ apache2handler cli cgi]
  --configure-options [--prefix=/usr/local/newco --with-openssl=/usr/local/ssl --with-openssl-dir=/usr/local/ssl --with-zlib-dir=/usr/local --with-libxml-dir=/usr/local/newco --with-curl=/usr/lib --with-apxs2=/usr/local/newco/httpd/bin/apxs --with-mysql --with-mysqli=mysqlnd --enable-embedded-mysqli --enable-sigchild --enable-mbstring=yes --enable-debug=no --enable-soap --with-pdo-mysql ]
  --version           [5.4.30]
  --vernum            [50430]

I'm sorry, I'm too new to comment so I have to send this as an answer instead.

I don't see the --enable-cli directive in your installation config file. Including that directive and then recompiling should fix the issue.

More information on that can be found toward the bottom of the third code snippet box in the following link for your convenience. http://gediminasm.org/post/compile-php