从bash执行php脚本时出错 [英] Error while executing php script from bash

查看:58
本文介绍了从bash执行php脚本时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从bash脚本执行php文件

Hi im trying to execute php file from bash script

#!/bin/sh

php ./func.php

func.php 文件看起来像

<?php

echo "php file";

并作为输出 PHP警告:模块'apc'已在第0行的Unknown中加载

也许您还可以告诉我如何将参数传递给php文件??

And maybe U can also tell me how to pass parameter to php file ??

推荐答案

第0行上的 Unknown中的错误表示您的配置有缺陷(与bash无关-直接运行程序应该会产生相同的消息).

An error in Unknown on line 0 means that your configuration is defective (this has nothing to do with bash - directly running the program should yield the same message).

在您的情况下,您的php配置中有两个 extension = apc.so 实例.用 grep apc.so/etc/php5/cli/-r 来找到它们.

In your case, you have two instances of extension=apc.so in your php configuration. Use grep apc.so /etc/php5/cli/ -r to find these.

这篇关于从bash执行php脚本时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆