codecept: command not found in PhpStorm + Babun - environment-variables

I´m trying to use Codeception for WordPress.
Environment
OS : Windows 10
IDE : PhpStorm
Terminal (in PhpStorm) : Babun
I managed with composer to build the project wp-browser but when I try to run a command with the key word codecept, I got this error :
bash: codecept: command not found
I checked my PhpStorm configuration in Settings > Languages & Frameworks > PHP > Test Frameworks and I can see :
Path to codeception executable : E:\path\my-test-project\vendor\codeception\codeception
I had in PATH for all users E:\path\my-test-project\vendor\codeception\codeception after following this question, without success.
When I test the command codecept in Babun outside the PHPStorm Terminal, that works, so it seems to be a PhpStorm problem.
What could be the thing I forgot ?

I tried again and now it works.
I´m not sure the reason why but it could be because on PHPStorm I clicked (to resolve an other problem ) on
File > Invalidated Caches / Restart....

Related

After installation of Hyperon not able to browse http://localhost:38080/hyperon/app

I have installed Hyperon a business rule engine on windows machine.
I have fallowed instruction to install it from:
- https://www.hyperon.io/tutorial/installing-hyperon-studio
After installation I have browse below URL to see whether #Hyperon web app is running or not.
http://localhost:38080/hyperon/app
I am getting this error:
Error Screenshot
Reproduceable Steps:
Downloaded hyperon zip and extracted it.
Open the file directory and reach to the /bin folder
Opened it in command prompt:
Ran startup.bat file.
Refer to below screenshot:
command prompt logs
tomcat command prompt logs and output after executing- startup.bat
Such effect occurs when trying to run hyperon with JDK 8.
Hyperon Studio requires JDK 11.
See installation guide:
https://www.hyperon.io/tutorial/installing-hyperon-studio
If you have multiple JDKs installed, you can swith to proper by setting JAVA_HOME variable:
for example:
cd c:\hyperon-studio-2.1.9\bin
set JAVA_HOME=c:\java\jdk-11.0.4
startup.bat
The first run may take a minute, because hyperon needs to initialize database schema.
Once it is fully started you will see hyperon.log file and should be able to access localhost:38080/hyperon/app.

Aqueduct/Dart new project command fails on Windows 7

I'm trying to create a project with the aqueduct command but I get the following errors :
C:\Users\Aelayeb>aqueduct create -n web_dart
Fetching Aqueduct as:
aqueduct: "any"
Determining Aqueduct template source...
ProcessException: Le fichier sp├®cifi├® est introuvable.
Command: pub get --no-packages-dir
It is written "File not found" (in french).
Also, I skipped the "aqueduct setup" step from the documentation because it fails to find psql and I don't need a database for this project.
After seeing the code for this setup step, I don't think it's mandatory (setup_command.dart).
But if I'm doing something wrong, or someone have an idea about the error, it would really helps me.
Btw, I'm testing this on a Windows 7 64bits computer.
Basically it seems that the command fails to switch directory before executing "pub get --no-packages-dir".
So when I replay "pub get" in the right directory, it seems to work.
EDIT : It's a problem with dart "Process.runSync()" method on windows which doesn't use the "PATH" env. When adding the "runInShell: true" parameters it seems to work.
More details here : github
The question now is : Is it working as intended ?

casperjs does not find phantomjs

I've downloaded the latest version of casperjs (1.03) and phantomjs (1.9.2).
So I took this little simple script from the casper page:
var casper = require('casper').create({
verbose: true,
logLevel: "debug"
});
var casper = new require('casper').Casper();
and when I try to run it I get the following error:
noname:phantomjs-1.9.2 Tom$ casperjs/bin/casperjs tipico2.js
Fatal: [Errno 2] No such file or directory; did you install phantomjs?
So, this is my directory structure:
phantomjs-1.9.2/ <-- the folder containing phantomjs
phantomjs-1.9.2/casperjs/ <-- a subfolder containting casperjs
Why does it not work?
The solution is actually very simple. Just export the path where the binary of phantomjs is. In my case this is /Users/Tom/Downloads/phantomjs-1.9.2/bin, hence
export PATH=$PATH:/Users/Tom/Downloads/phantomjs-1.9.2/bin
Faced the same problem when installed casper with npm globally on osx.
At first I've set environment variable PHANTOMJS_EXECUTABLE to path where phantomjs was installed (it's usually /usr/local/lib/node_modules/casperjs/node_modules/phantomjs/lib/phantom/bin/phantomjs phantomjs) with
export PHANTOMJS_EXECUTABLE=/usr/local/lib/node_modules/casperjs/node_modules/phantomjs/lib/phantom/bin/phantomjs phantomjs
this helped only partially as I still got an error like there's no file nor folder /usr/local/bin/phantomjs, so I've just created symlink and pointed it to real binary folder with
ln -s /usr/local/lib/node_modules/casperjs/node_modules/phantomjs/lib/phantom/bin/phantomjs /usr/local/bin/phantomjs
hope this will help someone :)
For OS X:
brew install casperjs --devel
brew install phantomjs
and it will works
If you are getting this error in PHP, place this above your exec:
<?php
putenv("PHANTOMJS_EXECUTABLE=/usr/local/bin/phantomjs");
?>
Where path /usr/local/bin/phantomjs is the path to your phantomjs install. You can get this by typing which phantomjs into terminal for example.
Solution For Windows
STEP 1 - Go to Environment Variables
Start -> Environment Variables -> Environment Variables
or
My PC -> Properties -> Advanced System Settings -> Environment Variables
STEP 2 - Set new PATH to your PhantomJS/bin folder
Select PATH (User or System) -> Edit
New -> Browse -> find your BIN folder in PhantomJS installation on your HDD
Accept
STEP 3 - Test Your Work
Open CMD -> Type "phantomjs -v"
You should get phantomJS version number as answer in any folder in your tree.
I had this problem. Tried on 2 different windows machines.
Deleted all npm installed versions from node_modules folders and AppData / Roaming....
Deleted phantom and casper from c:/ where initially installed.
Downloaded phantom and extracted to Program Files folder from https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-windows.zip
Downloaded casper and extracted to Program Files folder from https://github.com/casperjs/casperjs/zipball/1.1.0
Set System Environment Variable C:\Program Files\phantomjs-2.1.1-windows\bin
Set System Environment Variable C:\Program Files\casperjs-casperjs-b5c59e1\bin
I DIDN'T set PHANTOMJS_EXECUTABLE as some other posts have mentioned. Not sure whether it would make a difference, but 100% working with above steps on Windows 10 with Phantom 2.1.1 and casper 1.1.0
Faced the same problem after installing casperjs with npm globally on osx. The solution is actually very simple. You have to include these lines at the top of your script to connect casperjs with phantomjs.
phantom.casperPath = "/path_to/casperjs/";
phantom.injectJs(phantom.casperPath + "/bin/bootstrap.js");

Windows x64 RabbitMQ install error with Erlang environment var (ERLANG_HOME)

I'm ask/answering this question because it hung me up & it's likely someone else will have the same problem.
Install of RabbitMQ x64 v2.8.6 on Windows Server 2008 x64.
After Erlang install using default install location to C:\Program Files\erl5.9.2, I'm attempting to start the server via running the rabbitmq-service.bat. Fail:
Please either set ERLANG_HOME to point to your Erlang installation
or place the RabbitMQ server distribution in the Erlang lib folder.
Problem is the .bat file does not have the correct subpath. with 5.9.2 (R15B02) version of erlang. My ERLANG_HOME directory is set correctly, but the script does not use it correctly for this version of Erlang, which, it appears to this Erlang noob to have a new subdirectory called "erts-5.9.2" which is causing the problems. Maybe someone intimate with these scripts can describe how to make this work correctly without the hack workaround I'm about to describe?
1- Set environment variable:
Variable name : ERLANG_HOME
Variable value: C:\Program Files (x86)\erl6.4
note: don't include bin on above step.
2- Add %ERLANG_HOME%\bin to the PATH environmental variable:
Variable name : PATH
Variable value: %ERLANG_HOME%\bin
This works well.
There are several RabbitMQ control .bat files on windows. Every one you use needs to get changed to reflect the Erlang path correctly. In this example, I'm editing the rabbitmq-server.bat because it's one of the easier ones... any of the .bat files you want to run will need this hack to get them to work, with the rabbitmq_service.bat file being the most involved to adjust.
editing that rabbitmq_server.bat file, you can see on about line 48 or so there's a check to see if the erl.exe is found, but the path isn't correct:
if not exist "!ERLANG_HOME!\bin\erl.exe" (
that path does not match the file structure for the 5.9.2 version of Erlang. I fixed this by simply removing this path check from about line 48 to 58, then, where the .bat actually makes a call to the erl.exe on about line 129 which reads:
"!ERLANG_HOME!\bin\erl.exe"
I simply hardcoded the path to my erl.exe:
"C:\Program Files\erl5.9.2\erts-5.9.2\bin\erl.exe"
With the pathing correct, the rabbitmq .bat files will run.
I had the similar issue, modifying ERLANG_HOME in .bat files did not work. Then I tried echo %ERLANG_HOME% in command prompt, that did not print the environment variable value(I could see that ERLANG_HOME environment variable has been created under advance system settings), that lead me to believe that I need to restart server for 64 bit installation of Erlang. After rebooting server, It worked like a charm. I hope this helps someone.
Just to share an up-to-date answer as of 2019: On Windows Server 2019, after setting up the environment variable, a restart is required to solve the problem.
I got into same kind of problem.
I solved it by doing three changes as given below.
Update Path variable "ERLANG_HOME" : "C:\Program Files\erl8.0" in Environment Variables.
Upadte "Path" variable "Path" : ";%ERLANG_HOME%\bin;"
Give urself FULL CONTROL permissions over "Program Files" in C drive.
It worked for me in this way.
This problem still occurs in Erlang 18.3 (erl7.3) and RabbitMQ 3.6.9 on Windows when upgrading from any older version of RabbitMQ to version 3.6.9. The solution as already stated here is to manually set ERLANG_HOME with 'setx -m ERLANG_HOME "C:\Program Files\erl7.3"' before starting the service.
What happens is that the RabbitMQ 3.6.9 installer removes the environment variable ERLANG_HOME from the system while removing the older version of RabbitMQ. Then, when it proceeds to the installation step, it does not put back the ERLANG_HOME variable. Then, the batch files that start up RabbitMQ cannot find Erlang. They try to find Erlang's home directory using "where.exe" but it always fails after an upgrade.
RabbitMQ's installer also does not kill all of the Erlang background processes, causing many of its files to be undeletable due to the Windows "file in use" problem. This leaves behind "files in use" in %APPDATA%\RabbitMQ and "C:\Program Files\RabbitMQ." These processes are "erl.exe," "erlsrv.exe," and "epmd.exe." The RabbitMQ installer should taskkill these processes after shutting down the RabbitMQ Windows service.
RabbitMQ is rather clunky on Windows.
Download Erlang or OTP - Only one Version of OTP should be installed
Download RabbitMQ installer
Install both exe file as Administrator
Set class path for Erlang. (Setting classpath is a bit troublesome, so follow these steps)
Set a new path with name ERLANG_HOME and value C:\Program Files\erl-23.1 (do not copy bin folder here)
Edit System "path" and add %ERLANG_HOME%\bin
Go to Start - Open rabbitmq command promt and run
rabbitmq-plugins enable rabbitmq_management
Navigate to localhost:15672
Use guest/guest to login
Interesting that this worked for you. There is record of a two bugs in Erl5.9.2 that cause an incomplete installation where %ERLANG_HOME%\bin is not installed.
Either of
* Installed 64bit erlang on 32bit machine
* "The program can't start because MSVCR100.dll is missing from your computer."
https://groups.google.com/d/topic/erlang-programming/wGtFLzapiQ0/discussion
Try 5.9.1 or any other version. They also mention making the future versions of the installer alert you if it fails.
I just had the same problem mentioned here. I installed otp_win64_R15B02 on a Windows 7 machine and everything worked perfectly, but I used the same installer on a Windows 2008 server and the bin directory was not created. I then uninstalled otp_win64_R15B02 and downloaded the otp_win64_R15B02_with_MSVCR100_installer_fix and the bin directory was created.
I suspect the reason it worked on my Windows 7 system is that I have Visual Studio installed and the required libraries were already available which allowed the otp_win64_R15B02 installer to work correctly.
Oh, and if you're installing Erlang to run RabbitMQ the RabbitMQ install will succeed with the broken installer but installing otp_win64_R15B02_with_MSVCR100_installer_fix after RabbitMQ will not work, just un-install and re-install RabbitMQ to resolve this.
Just give C:\Program Files\erl10.6\ not C:\Program Files\erl10.6\bin\erl.exe in the environment variable. If you open the server.bat file I came to know the issueenter image description here
I think this is encoding issue on windows.I see a correct value but I write echo %ERLANG_HOME% on console the value come with question mark. These steps fix it.
1.go environment variable window
2.edit ERLANG_HOME item
3.copy the value, open notepad and paste there
4.copy again on notepad and paste to edit window
5.apply and exit window
6.close command line tools and reopen
7.run rabbitmq bat file.
I solved it in a quick and dirty way,without naming path variables
I've opened the bat file and replaced every occurrence of
!ERLANG_HOME!\bin\erl.exe
with hard coded path for example might be diffrent path for you because of diffrent version
C:\Program Files\erl10.3\erts-10.3\bin\erl.exe
and replaced
%RABBITMQ_HOME%\escript\rabbitmq-plugins
with
C:\Program Files\RabbitMQ Server\rabbitmq_server-3.7.14\escript\rabbitmq-plugins
Even I was this problem. The issue was the environment variable ERLANG_HOME=c:\Program Files\erl9.0 which was never existed.
I cross checked the path. The correct path was c:\Program Files\erl9.3.
After correcting the
ERLANG_HOME=c:\Program Files\erl9.3
the problem solved. So, definitely it is a path issue.
In my case, it should be installed erlang using admin role running
If above solutions doesn't work for you then you can try following
Find another compatible version of erlang for your rabbit mq e.g. for rabbit 3.7.x erlang version 20.3.x to 22.0.x all are compatible .
Right click newly downloaded erlang version and from properties select the option to unblock the file .
Run the erlang with admin persssion .
Re run rabbit mq exe

How to install ImageMagick on Windows 7 (2)

Hopefully, despite similar question titles, this isn't a duplicate issue.
I've installed ImageMagick-6.7.5-6-Q16-windows-dll.exe.
I have php_imagick_dyn-Q16.dll renamed to php_imagick.dll in PHP's ext directory.
I have extension=php_imagick.dll in my php.ini.
I try to run a basic test: php -r "var_dump(class_exists('Imagick'));".
I get this error:
PHP Startup: imagick: Unable to initialise module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options must match.
CLI has stopped working.
Windows can check online for a solution to the problem.
> Check online for a solution and close the program
> Close the program
What have I done wrong?
First install :
Link
Download :
http://www.sk89q.com/2010/03/vc6-windows-binaries-for-imagick-2-3-0/
Choose the TS one
Open your php.ini file
Add this line :
extension=php_imagick.dll
Restart your apache server
open php_info()
Now your imagick lib is ready to use.
This works for me.

Resources