且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

尝试使用&QUOT运行PHP文件; Heroku的运行"我也得到" bash的权限被拒绝"

更新时间:2022-05-01 09:11:03

有你需要做的几件事情。

There are a couple of things you need to do.


  • 当创建Heroku的应用程序,您必须确保该PHP buildpack使用。这是将注入PHP运行到应用程序中塞。无论是添加的index.php 文件(这是PHP如何检测)或硬code这样的: Heroku的配置:添加BUILDPACK_URL = HTTPS://github.com/heroku/heroku-buildpack-php.git

  • 详细介绍这个问题设置库路径:Heroku的配置:添加LD_LIBRARY_PATH = /应用程序/ PHP /分机:/应用/阿帕奇/ lib目录

  • 运行你的东西: Heroku的运行./php/bin/php --version

  • When creating the Heroku application, you have to make sure that the PHP buildpack is used. This is what will inject the PHP runtime into your application slug. Either add a index.php file (which is how PHP is detected) or hard-code it like this: heroku config:add BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-php.git
  • Set the library path as detailed in this question: heroku config:add LD_LIBRARY_PATH=/app/php/ext:/app/apache/lib
  • Run your stuff: heroku run ./php/bin/php --version

要总结一下:

heroku config:add BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-php.git
heroku config:add LD_LIBRARY_PATH=/app/php/ext:/app/apache/lib
heroku run ./php/bin/php --version

调试这个一个有用的方法是来砸到运行的Heroku的赛道:的Heroku运行的bash 。这将让你闲逛,看到那里的东西是在和实验。

A useful way to debug this is to bash into the running Heroku dyno: heroku run bash. That will let you poke around, see where things are at and experiment.