Apache/PHP 5.3 上的 PEAR,.phar
昨天,我设法使用 SSH 在我的一台客户服务器上安装了 PEAR。今天我尝试将其安装在类似的服务器上,但没有 SSH 访问。
pear.php.net 上的手册声称:
如果您在网络上运行您的网站 无法直接访问的托管提供商 到服务器(通过本地登录, Telnet 或 SSH),可以使用 PEAR 使用 Web 前端的安装程序或 (S)FTP。
转到http://pear.php.net/go-pear.phar 并另存为 go-pear.phar。复制 go-pear.phar 到您的服务器并打开 浏览器中相应的 URL, 例如 http://example.com/pear/go-pear.phar。
所以我下载了它,通过 FTP 将其放入文件夹中......我可以看到文件的内容。 我尝试通过 file_put_contents(file_get_contents()) 下载它,然后再次......除了内容之外什么都没有 - 但没有我期望的“安装界面”。
所以我对 Archives 完全陌生,尤其是 PHP-Archive。但是,如何在不使用 SSH(或 Telnet 等)而仅使用 FTP 的情况下安装 PEAR?如何在浏览器中“执行”.phar 文件,如 pear.php.net 文档所述?
此外,安装 PEAR 后如何安装软件包?毕竟..仍然没有命令行。
我尝试的更多事情是调用存档文件:
include('phar://go-pear.phar/index.php');
但这并没有让我走得太远。我现在可以看到“下面是新 PEAR 安装的建议文件布局。要更改各个位置,请在前面键入数字...”,这是标准的 PEAR 安装介绍,但这只是一个文本< /强>。我如何告诉文本更改目录...? :confused:
非常感谢您的帮助。我确实搜索了文档和谷歌,但是在两者中我都找不到答案。
运行:Apache/2.2.16 上的 PHP 5.3.2
无法访问 httpd.conf,只能访问 .htaccess。这是一个共享服务器。
Yesterday I managed to install PEAR using SSH on one of my customers servers. Today I tried to install it on a similar Server but without SSH-access.
The manual on pear.php.net claims that:
If you are running your site at a web
hosting provider with no direct access
to the server (via local logins,
Telnet or SSH), you can use the PEAR
Installer using the Web Frontend or
(S)FTP.Go to http://pear.php.net/go-pear.phar
and save as go-pear.phar. Copy
go-pear.phar to your server and open
the corresponding URL in your browser,
for example
http://example.com/pear/go-pear.phar.
So I downloaded it, put it in the folder via FTP and... i can see the contents of the file.
I tried downloading it by file_put_contents(file_get_contents()) and again.. nothing but the contents - but no "Installing Interface", which i expected.
So I'm totally new to Archives, especiall the PHP-Archive. But how do I manage to install PEAR without SSH (or Telnet, etc...) only with FTP? How do I "execute" a .phar file in the Browser like the Doc of pear.php.net states?
And furthermore, how do I install packages after installing PEAR? After all.. there is still no command line.
On more thing I tried is to call the archive file:
include('phar://go-pear.phar/index.php');
However this doesn't get me far. I now can see "Below is a suggested file layout for your new PEAR installation. To change individual locations, type the number in front....", which is the standard PEAR installation introduction BUT this is only a text. How could I tell a text to change the directory... ? :confused:
Thanks a lot for your help. I really searched the docs and google however in both I could not find the answer.
Running: PHP 5.3.2 on Apache/2.2.16
No access to httpd.conf, only .htaccess. It's a shared server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能忘记将
.phar
添加到httpd.conf
中的可解析 php 文件列表中。You propably forgot to add
.phar
to the list of parsable php files inhttpd.conf
.为什么不在本地安装 PEAR,然后将其与您需要/想要的类一起上传?如果您无法访问 CLI,这可能是最简单的方法。
请参阅在共享主机上安装本地 PEAR 副本
Why don't you install PEAR locally and just upload it with the classes you need/want? That's probably the easiest way to do it if you don't have access to the CLI.
See Installation of a local PEAR copy on a shared host