Chinaunix

标题: Linux命令行运行php文件 [打印本页]

作者: leej09    时间: 2011-05-16 14:45
标题: Linux命令行运行php文件
本帖最后由 leej09 于 2011-05-16 14:57 编辑

如题

在安装目录php/bin/下的没有php可执行文件 只有php-config 和 phpize 这两个文件

源码编译安装的php
作者: 1jjk    时间: 2011-05-16 15:06
能把你的configure的参数发出来看看不
你怎么configure的
作者: leej09    时间: 2011-05-16 15:15
本帖最后由 leej09 于 2011-05-16 15:57 编辑

回复 2# 1jjk


    ./configure --prefix=/lamp/php --with-apxs2=/lamp/apache/bin/apxs --with-config-file-path=/lamp/php --enable-safe-mode --with-libxml-dir=/usr/lib --enable-mbstring --with-mysql=/lamp/mysql --with-mysql-sock=/lamp/mysql/tmp --with-mysqli=/lamp/mysql/bin/mysql_config --with-pdo-mysql=/lamp/mysql --enable-soap --enable-sockets --with-curl=/usr --with-xsl=/usr/lib  --with-zlib --with-zlib-dir=/usr --with-libexpat-dir=/user/lib --enable-short-tags --enable-static --with-gd=/usr --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-freetype-dir=/usr/include/freetype2 --enable-sysvshm --enable-sysvsem --with-pdflib-dir=/usr/local/lib --with-t1lib=/usr/local/t1lib --with-gettext=/usr/bin/ --enable-calendar --enable-ftp --enable-inline-optimization --disable-cgi --disable-cli --with-openssl=/usr --with-openssl-dir=/usr


求解
作者: 1jjk    时间: 2011-05-16 16:23
  1. export PATH=/lamp/php:$PATH
复制代码
然后php -v就可以了
作者: leej09    时间: 2011-05-16 17:00
回复 4# 1jjk


   
然后php -v就可以了
1jjk 发表于 2011-05-16 16:23


    我执行php -v  打印出:
        Configuring for:
        PHP Api Version:         20090626
        Zend Module Api No:      20090626
        Zend Extension Api No:   220090626

    当我执行 php /lamp/www/echo.php (echo.php中不存在语法问题) 提示如下
        Cannot find config.m4.
        Make sure that you run '/usr/bin/php' in the top level source directory of the module

是不是我的命令执行错误 还是什么问题?
作者: 1jjk    时间: 2011-05-16 17:08
还是 --prefix=/usr/试试呢?
作者: leej09    时间: 2011-05-16 17:18
回复 6# 1jjk


    兄台,实在不是很懂,叫我QQ详聊行吗  564968425  注意加个备注呀 呵呵
作者: 1jjk    时间: 2011-05-16 17:24
./configure --prefix=/usr --with-apxs2=/lamp/apache/bin/apxs --with-config-file-path=/lamp/php --enable-safe-mode --with-libxml-dir=/usr/lib --enable-mbstring --with-mysql=/lamp/mysql --with-mysql-sock=/lamp/mysql/tmp --with-mysqli=/lamp/mysql/bin/mysql_config --with-pdo-mysql=/lamp/mysql --enable-soap --enable-sockets --with-curl=/usr --with-xsl=/usr/lib  --with-zlib --with-zlib-dir=/usr --with-libexpat-dir=/user/lib --enable-short-tags --enable-static --with-gd=/usr --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-freetype-dir=/usr/include/freetype2 --enable-sysvshm --enable-sysvsem --with-pdflib-dir=/usr/local/lib --with-t1lib=/usr/local/t1lib --with-gettext=/usr/bin/ --enable-calendar --enable-ftp --enable-inline-optimization --disable-cgi --disable-cli --with-openssl=/usr --with-openssl-dir=/usr
作者: leej09    时间: 2011-05-16 17:32
回复 8# 1jjk


    哦,你指的是重新编译。  我的php /lamp/www/echo.php 没有问题吧
作者: 版主杀手    时间: 2011-05-17 11:40
删除 原来的p'h'p
重新编译
作者: leej09    时间: 2011-05-17 17:30
回复 10# 版主杀手


    果然版主杀手  能不能给详细的 配置信息
作者: 版主杀手    时间: 2011-05-17 21:37
回复  版主杀手


    果然版主杀手  能不能给详细的 配置信息
leej09 发表于 2011-05-17 17:30


1.先覆盖安装吧,然后看结果如何
   
2.不行的话先删掉
find / -name "*php*" | xargs rm -rf {};--这条命令小心用 这只是理论上的
然后重新编译
作者: goota081    时间: 2011-05-19 11:37
嗯,删除,重新编,试下。
作者: 只爱睡觉    时间: 2011-05-19 11:55
make clean
作者: autowheelpart    时间: 2011-05-20 10:17
{:2_177:}  人才据集地啊!
作者: wsp668756    时间: 2011-05-20 16:04
看看




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2