Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trying to run heroku locally and get a error 'vendor' is not a command

I am trying to run heroku locally using the command

heroku local

However, it returns:

[OKAY] Loaded ENV .env File as KEY=VALUE Format
'vendor' is not recognized as an internal or external command, operable program or batch file.
[DONE] Killing all proccess with signal null
Exited with exit code 1

I am using Heroku PHP within Windows 7

In my PATH environmental variable, I have both: ./vendor/bin and C:\Users\user-name\AppData\Roaming\Composer\vendor\bin

(The last one is an empty folder)

I searched for anything similar but I couldn't find. Any thoughts on it?

Thanks in advance

Update

The error was in my Procfile:

web: vendor/bin/heroku-php-apache2 public/

Then I change all slashes to backslashes ():

web: vendor\bin\heroku-php-apache2 public\

Now its working but I am getting this error:

../heroku/heroku-buildpack-php/bin/heroku-php-apache2: line 196: php-fpm: command not found
This program requires PHP 5.5.11 or newer; check your 'php-fpm' command.

I think there is something wrong related to my composer.

The source file for heroku-php-apache2 can be found here. The line 196 is presented below.

196: { php-fpm -n -v | php -n -r 'exit((int)version_compare(preg_replace("#PHP (\S+) \(fpm-fcgi\).+$#sm", "\\1", file_get_contents("php://stdin")), "5.5.11", "<"));'; } || { echo "This program requires PHP 5.5.11 or newer; check your 'php-fpm' command." >&2; exit 1; }

My composer.json file is:

{
  "require" : {
    "ext-mcrypt": "*",
    "facebook/php-sdk-v4" : "~5.0",
    "google/apiclient": "2.0"  
  },
  "require-dev": {
        "mashape/unirest-php": "3.*",
        "heroku/heroku-buildpack-php": "*"
    }
}

I tried to specific require php in composer.json but it didn't changed. Any thoughts on that? Thank you in advance.

like image 663
Jean Phelippe Avatar asked Nov 08 '22 10:11

Jean Phelippe


1 Answers

Years later, I've faced this same issue.

Fixed by removing vendor/ and running composer install again.

Then I've faced the same php-fpm error and to fix that I created a symbolic link from /usr/sbin/php-fpm7.4 -> /usr/sbin/php-fpm.

Hope that becomes helpful to orthers in the future!

like image 149
fagiani Avatar answered Nov 14 '22 22:11

fagiani