简体   繁体   English

在Apache / PHP 5.3,.phar上使用PEAR

[英]PEAR on Apache/PHP 5.3, .phar

Yesterday I managed to install PEAR using SSH on one of my customers servers. 昨天我设法在一台客户服务器上使用SSH安装了PEAR。 Today I tried to install it on a similar Server but without SSH-access. 今天,我尝试将其安装在类似的服务器上,但没有SSH访问权限。

The manual on pear.php.net claims that: pear.php.net上的手册声称:

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. 如果您在无法直接访问服务器(通过本地登录名,Telnet或SSH)的网络托管服务提供商处运行站点,则可以使用Web Frontend或(S)FTP使用PEAR安装程序。

Go to http://pear.php.net/go-pear.phar and save as go-pear.phar. 转到http://pear.php.net/go-pear.phar并另存为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 . 将go-pear.phar复制到您的服务器,然后在浏览器中打开相应的URL,例如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. 因此,我下载了该文件,并通过FTP将其放置在文件夹中,...我可以看到文件的内容。 I tried downloading it by file_put_contents(file_get_contents()) and again.. nothing but the contents - but no "Installing Interface", which i expected. 我尝试通过file_put_contents(file_get_contents())下载它,然后再次..除了内容-什么都没有,但我没有期望的“安装接口”。

So I'm totally new to Archives, especiall the PHP-Archive. 因此,我对Archives完全陌生,尤其是PHP-Archive。 But how do I manage to install PEAR without SSH (or Telnet, etc...) only with FTP? 但是,如何仅通过FTP如何在没有SSH(或Telnet等)的情况下安装PEAR? How do I "execute" a .phar file in the Browser like the Doc of pear.php.net states? 我该如何在浏览器中“执行” .phar文件,如pear.php.net状态文档?

And furthermore, how do I install packages after installing PEAR? 而且,在安装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 . 现在,我可以看到“以下是建议的新PEAR安装文件布局。要更改各个位置,请在前面键入数字...。”,这是标准的PEAR安装简介,但这只是文本 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. 我确实搜索了docs和google,但是我都找不到答案。

Running: PHP 5.3.2 on Apache/2.2.16 运行:Apache / 2.2.16上的PHP 5.3.2

No access to httpd.conf, only .htaccess. 无权访问httpd.conf,只有.htaccess。 It's a shared server. 这是一台共享服务器。

您可能忘记将.phar添加到httpd.conf中可分析的php文件列表中。

AddType application/x-httpd-php .phar

Why don't you install PEAR locally and just upload it with the classes you need/want? 为什么不在本地安装PEAR并仅将其与所需/想要的类一起上传? That's probably the easiest way to do it if you don't have access to the CLI. 如果您没有访问CLI的权限,那可能是最简单的方法。

See Installation of a local PEAR copy on a shared host 请参阅在共享主机上安装本地PEAR副本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM