凡在我的服务器是提供Web页的PHP版本? [英] Where on my server is the PHP version that serves web pages?

查看:442
本文介绍了凡在我的服务器是提供Web页的PHP版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个共享的服务器上。当我保存脚本的phpinfo()键,在浏览器中打开它,该脚本告诉我:PHP版本5.6.18

I'm on a shared server. When I save a script with phpinfo() and open it in the browser, the script tells me "PHP Version 5.6.18":

在这里输入的形象描述

当我访问我的服务器通过SSH,并期待在的/ usr / local / bin目录 LS 显示我的PHP版本为4至5.5,但没有5.6版:

When I visit my server through SSH and look in /usr/local/bin, ls shows me PHP versions from 4 to 5.5, but no version 5.6:

在这里输入的形象描述

当我搜索PHP和的PHP ,我得到以下(从 ... -v 在括号中):

When I search for PHP with which php, I get the following (with results from ... -v in parentheses):

/usr/bin/php (4.4.9)
/usr/bin/php4.4
/usr/bin/php5.2
/usr/bin/php5.4
/usr/bin/php5.5
/usr/bin/php5.4-cli
/usr/bin/php5.5-cli
/usr/bin/php4.4-cli
/usr/bin/php5.2-cli
/usr/lib/php (directory, contains extensions)
/usr/lib/php4.4
/usr/lib/php5.4
/usr/lib/php5.5
/usr/lib/php5.2
/usr/local/bin/php (4.4.9)
/usr/local/bin/php5.4
/usr/local/bin/php5.5
/usr/local/bin/php4.4
/usr/local/bin/php5.2
/usr/local/lib/php.ini-nourl
/usr/include/php4.4
/usr/include/php5.4
/usr/include/php5.5
/usr/include/php5.2
/usr/local/php (4.4.9)
/usr/share/php (directory, contains: libzend-framework-php  wp-cli)

那么,是PHP 5.6?

So where is PHP 5.6?

我想用相同的PHP或类似的版本作为一个服务网页,运行通过一个cronjob脚本例如。

I want to run a script through a cronjob using the same PHP or a similar version as the one serving web pages, e.g.

0 * * * *  /usr/local/bin/php5.6 -f/path/to/script.php

但我不知道在哪里PHP 5.6的生命。

but I don't know where PHP 5.6 lives.

如何才能找到PHP 5.6我的服务器上?

我运行的Apache共享的Linux服务器上。我打电话给我的托管服务提供商,但在周末的工作人员根本不知道,问我在星期一打电话。你能在那之前帮我吗?

I'm on a shared Linux server running Apache. I called my hosting provider but the weekend staff has no idea and asked me to call on Monday. Can you help me before then?

推荐答案

PHP恒 PHP_BINARY 保持当前的PHP间preTER的信息:

PHP constant PHP_BINARY keeps info of current PHP interpreter:

<?php var_dump(PHP_BINARY); ?>

这将返回soomething这样的:串(13)的/ usr / bin中/ PHP5
然后:

$ /usr/bin/php5 -v

在您的具体情况可能 PHP5 是PHP V5.6。

In your specific case probably php5 is the PHP v5.6.

这篇关于凡在我的服务器是提供Web页的PHP版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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