I'm trying to configure Heroku Local on a Windows 10 machine.
Composer, php, git, and heroku are installed fine, and my procfile look like this:
dev: vendor\bin\heroku-php-nginx -i php.conf.ini -c nginx.conf.php
but when i try to run, give me this error:
dev.1 | 'vendor\bin\heroku-php-nginx' is not recognized as an internal
dev.1 | or external command, operable program or batch file.
[DONE] Killing all processes with signal null
Exited with exit code 1
seens like windows can't run the bash file of heroku-php-nginx?
https://github.com/heroku/heroku-buildpack-php/blob/master/bin/heroku-php-nginx
What i can do?
Related
OS: Windows 10
yesterday I install xampp because I want to learn laravel.
everything is normal. I setup laravel and all. and I got to develop some progress.
before I went to sleep, I turn off my laptop.
in the morning, I open my project and run php artisan serve. then I got
'php' is not recognized as an internal or external command,
operable program or batch file.
I try to check my environment. I found that PHP is gone from the environment. so I add PHP (again) in the environment table.
and still, got the same error
'php' is not recognized as an internal or external command,
operable program or batch file.
so I check the path C:/xampp/php. turns out, there is no php.exe
then I run where php.exe from cmd in the directory C:/. and got
C:\>where php.exe
INFO: Could not find files for the given pattern(s).
Is there any solution so I can use PHP again?
I've been trying to connect my local files to my app using `heroku local web`, but it throws this error:
3:24:15 AM web.1 | 'vendor' is not recognized as an internal or external command,
3:24:15 AM web.1 | operable program or batch file.
[DONE] Killing all processes with signal SIGINT
3:24:15 AM web.1 Exited with exit code null
I'm sure my Procfile is there in the directory and here is the command line web: vendor/bin/heroku-php-apache2.What I'm doing wrong? What is vendor and why it's not recognizing it?
Additional info:
OS: Windows 10
buildpack: PHP
Based on the error message, it looks like you're running this in cmd.exe. Commands there often use forward slashes for options (e.g. foo /a /b) instead of dashes (e.g. foo -a -b).
I believe the slashes in your command are being interpreted as options, making vendor the command that would run.
A common pattern for using a different command local development on Windows is to create a file called Procfile.windows containing a Windows-specific command, e.g. one that uses backslashes instead of forward slashes, and then run locally as heroku local -f Procfile.windows.
But that heroku-php-apache2 binary is unlikely to run on Windows, so that will be insufficient. The getting started with PHP page is notably missing the "run the app locally" step that, for example, the Python page has.
One good option is to use Windows Subsystem for Linux to run a Linux distribution in Windows and develop there. Another might be to use something like Docker or Vagrant to run a development environment in a virtual machine.
Or, if you have PHP installed on Windows already, try using something like php -S instead of Apache:
web: php -S localhost:8000 -t main_folder/
Make sure to keep your existing Procfile as you'll want to use that on Heroku. php -S should only be used for local development.
You might also simply have better luck using PowerShell instead of cmd.exe. It is generally much better-behaved.
I am trying to run a symfony command via the command line. On writing the below command
bin/console doctrine:database:create
it outputs an error
'bin' is not recognized as an internal or external command,
operable program or batch file.
php is installed on my machine and configured in environment variables but I am getting that error. Please what could be wrong?
This is a Linux like command. Obviously you are coming from Windows system:
php bin\console doctrine:database:create
Pro tip: you can shortcut commands as long as the shortcut is unique:
php bin\console doc:dat:cr
Make sure you cd to the app's directory before running the command too.
I have PHP apps deployed on Heroku. How can I run a Command Line PHP Script on an app even though I don't have command line access or terminal access to the server?
( this assumes that you already have an existing PHP app deployed to Heroku )
1) Install Heroku's Command Line Tool "Heroku Toolbelt" in your local dev environment.
2) Then run this in your local terminal window:
PHP Internal Commands:
heroku run php --version
Your PHP Scripts:
sudo heroku run php path/to/file.php
( may not need to use sudo - taken from an example - I don't use sudo )
How to run the command on a specific App.
I have several apps running on Heroku and I usually add -a :
heroku run php path/to/file.php -a <app name>
A Default App can be set to avoid having to specify the app every time:
heroku git:remote -a <app name>
I'm trying to start use selenium server with my Yii2 project.
I successfully installed selenium-server-standalone on win 10 with that command:
composer global require se/selenium-server-standalone
But when I try to start selenium-server-standalone I have error message::
sh is no internal or external
command, operable program or batch file.
There is java and selenium in my PATH, also I have a selenium-server-standalone.bat file in C:\Users\***\AppData\Roaming\Composer\vendor.
Please, tell me how can I solve this problem.
You have mentioned you are trying to run selenium server on Win10 machine and error you are facing is sh is no internal or external command, operable program or batch file.
Seems you are typing sh selenium-server-standalone.bat in your command. that is for Linux.
For windows machine, simply go to your path where batch file is located (C:\Users\***\AppData\Roaming\Composer\vendor) , type selenium-server-standalone.bat and hit enter. Selenium server will start.