heroku-php本地环境-无效路径


heroku php local environment - invalid paths

我安装了composer,它将所有符号链接放在项目的"vendor/bin"目录中。我没有更改上面创建的任何配置文件。

当我运行工头启动时,我得到以下问题:

$ foreman start -f Procfile.dev
17:31:28 web.1  | started with pid 63713
17:31:28 web.1  | Booting on port 5000...
17:31:28 web.1  | DOCUMENT_ROOT changed to '/Users/padawan/Desktop/progetti/gdb/sketchin-heatmap/web'
17:31:28 web.1  | Using PHP-FPM configuration file '/heroku/heroku-buildpack-php/conf/php/php-fpm.conf'
17:31:28 web.1  | Using PHP configuration (php.ini) file '/heroku/heroku-buildpack-php/conf/php/php.ini'
17:31:28 web.1  | Using Nginx server-level configuration include 'nginx_app.conf'
17:31:28 web.1  | Using Nginx configuration file '/heroku/heroku-buildpack-php/conf/nginx/heroku.conf.php'
17:31:28 web.1  | Interpreting /heroku/heroku-buildpack-php/conf/nginx/heroku.conf.php to heroku.conf
17:31:28 web.1  | vendor/bin/heroku-php-nginx: line 17: /Users/padawan/Desktop/progetti/gdb/sketchin-heatmap//heroku/heroku-buildpack-php/conf/nginx/heroku.conf: No such file or directory
17:31:28 web.1  | Starting log redirection...
17:31:28 web.1  | Starting php-fpm...
17:31:28 web.1  | Starting nginx...
17:31:28 web.1  | [30-Jun-2014 17:31:28] ERROR: failed to open configuration file '/Users/padawan/Desktop/progetti/gdb/sketchin-heatmap//heroku/heroku-buildpack-php/conf/php/php-fpm.conf': No such file or directory (2)
17:31:28 web.1  | [30-Jun-2014 17:31:28] ERROR: failed to load configuration file '/Users/padawan/Desktop/progetti/gdb/sketchin-heatmap//heroku/heroku-buildpack-php/conf/php/php-fpm.conf'
17:31:28 web.1  | [30-Jun-2014 17:31:28] ERROR: FPM initialization failed
17:31:30 web.1  | nginx: [alert] could not open error log file: open() "/usr/local/var/log/nginx/error.log" failed (13: Permission denied)
17:31:30 web.1  | 2014/06/30 17:31:30 [emerg] 63764#0: open() "/Users/padawan/Desktop/progetti/gdb/sketchin-heatmap//heroku/heroku-buildpack-php/conf/nginx/heroku.conf" failed (2: No such file or directory) in command line

我不明白为什么从未插入供应商文件夹:例如,PHP-FPM配置文件的路径是"/heroku/heroku buildpack PHP/conf/PHP/PHP-FPM.conf",而不是真正的">/vvendor/heroku/heroku buildpack PHP/conf/PHP FPM.conf">

我正在使用这个构建包:https://github.com/CHH/heroku-buildpack-php

这里是我的文件:

//Procfile.dev

web: vendor/bin/heroku-php-nginx -C nginx_app.conf web/

//nginx_app.conf

location / {
# try to serve file directly, fallback to rewrite
try_files $uri @rewriteapp;
}
location @rewriteapp {
    # rewrite all to index.php
    rewrite ^(.*)$ /index.php/$1 last;
}
location ~ ^/(app|app_dev|config)'.php(/|$) {
    fastcgi_pass heroku-fcgi;
    fastcgi_split_path_info ^(.+'.php)(/.*)$;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param HTTPS off;
}

//composer.json

{
"name": "sketchin-heatmap",
"require": {
    "php": ">=5.4.0",
    "ext-mongo": "*",
    "silex/silex": "~1.0@dev",
    "twig/twig": ">=1.8,<2.0-dev",
    "symfony/twig-bridge": "~2.3"
},
"require-dev": {
        "heroku/heroku-buildpack-php":"*"
    },
    "extra": {
        "heroku": {
            "document-root": "web",
            "index-document": "index.php"
        }
    }
}

您需要全局安装composervendor文件夹是通过运行composer config vendor-dir在启动脚本中确定的。在你的情况下,这似乎失败了。

您的项目中可能只有一个composer.phar,但路径? If so, copy composer.phar to e.g./usr/local/bin/composer`上没有composer命令吗。