Selected the second PHP version, but on the command line it's still the first - directadmin

I have installed 2 PHP version in my DirectAdmin environment: php5.5 (php1_release) and php7.1 (php2_release). Now I have one user set to php 7.1 with the PHP Versions Selector under Domain Setup. On the website in the browser it seems to work well, phpinfo tells me that php7.1 is running for this domain. But when I use composer from the command line it gives an error because it detects php5.5:
Any ideas how to solve this?

Try compiling with the full path of the php binary - "/usr/local/php70/bin/php70" - instead of just "php". Now command will be like that.
/usr/local/php70/bin/php70 composer.phar update
Important note : PHP binary Path will be different for each server.

Related

WordPress and React - Fronitity framework Internal Server Error

I tried this framework called Frontity. For the first try (run) everything was good, I had my demo page, and it worked well. I follow these instructions.
For the second compile I got these error, and a lot: There are multiple modules with names that only differ in casing.
Only change what I have done was this one (connecting my frontity to my WordPress): https://docs.frontity.org/getting-started/connecting-to-wordpress
(Again: for the first run, it was good.)
Nothing, literally nothing was changed, I do not even started any other software :)
After all this, I deleted everything, moved to another folder, started over the whole thing and for now I only get the same errors, and an Internal Server Error in my browser.
I have this issue with or without running the xampp server.
Any idea what went wrong?
Localhost WordPress (xampp), localhost:3000 Frontity (default), Windows 10, Chrome browser.
errors after compile
Your problem is here in the console output:
I'm not sure at which point those files with differing cases are
generated, but I think the following should fix your issue:
https://stackoverflow.com/a/53901224/2638310
Ensure that the path you used in your terminal has the correct
capitalization. For example if you're using git bash on Windows and
your project has the following path:
C:\MyProjects\project-X
If you access it using cd /c/myprojects/project-x (note the lack of
capital cases) and then run npm start you might face this problem.
The solution would be to consider the project path case-sensitive and
use it as follows:
cd /C/MyProjects/project-X

Warning: node.js detection failed, sbt will use the Rhino based Trireme JavaScript engine

I'm new to Play framework. Please explain the meaning of the below warning.
Warning: node.js detection failed, sbt will use the Rhino based Trireme JavaScript engine instead to run JavaScript assets compilation, which in some cases may be orders of magnitude slower than using node.js
I don't want anything that slow down my application so please advice if I should change the JS Engine to Node.js, but my PlayFramework project is using Java on the server side.
You need to install Node.js and then tell the sbt/java engine to use it.
brew install node
Edit .bash_profile and add:
export SBT_OPTS="${SBT_OPTS} -Dsbt.jse.engineType=Node -Dsbt.jse.command=$(which node)"
This eliminated the warning for me on OSX
In Windows:
Install node.js
Go to Control Panel - System and Security - System - Advanced system settings
Click Environment Variables...
Search in System variables for SBT_OPTS
If such exists, click Edit... and concatenate -Dsbt.jse.engineType=Node to Variable value
If such does NOT exist, click New... and write SBT_OPTS to Variable name and -Dsbt.jse.engineType=Node to Variable value
Click OK - OK - OK
Restart any command prompt (cmd, PowerShell) that is currently running Play Framework
in ubuntu
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install -y nodejs
then add as above to your .profile in your home directory
export SBT_OPTS="${SBT_OPTS} -Dsbt.jse.engineType=Node -Dsbt.jse.command=$(which node)"
then
. ./.profile
to reload your .profile
For a more flexible install using node version manager check the following tutorial:
how to install node js on an ubuntu 14.04 server
Build again and the warning about using the Trireme stuff should be gone.
As an alternative to setting the environment variable, you can add this line to your build.sbt file:
JsEngineKeys.engineType := JsEngineKeys.EngineType.Node
See: https://github.com/sbt/sbt-js-engine
sbt plugins requiring a JS engine are used only in the build process, and so missing Node.js only slows down assets building stages if you use any.
The built application is not affected.
Anyway, you may want to install node.js to your PATH, where it should be auto-detected.
in Windows 10:
Install node.js from https://nodejs.org/en/
(The installer automatically adds node.js to your PATH)
then add:
export SBT_OPTS="$SBT_OPTS -Dsbt.jse.engineType=Node"
to your plugins.sbt in
. ./project/plugins.sbt
Worked for me - the warning has disappeared!
EDIT:
Apparently plugins.sbt was the wrong place to add the
export SBT_OPTS="$SBT_OPTS -Dsbt.jse.engineType=Node"
...although the warning disappeared when loading my app, it led to an error when relaunching the app a couple of hours later:
error: not found: value export
I would be glad if anyone could help and tell me where to put the export.

Can't run Yii 2.0 cmd tool on Linux EC2 AWS

I've developed an application locally using Yii 2.0 framework (on a windows machine). And since i've installed the framewrok i was able to go to the projects folder and tun .\yii and see a list of commands that i could run. I use a lot of custom commands for this application that i have developed.
the thing is that i just uploaded my application to an EC2 instance on AWS, and for some reaon the framework works fine ( i can run my app) but i can't run .\yii on the script shell.
It is a Linux Instance
I've searched a lot for answers but i didn't find anything!
I've tried running: yii, .\yii, ./yii none of tem work, it seems like the cmd doesn't recognize the shell script, the error that i get is:
-bash: sudo: command not found
So, am i forgetting some configuration that i should have done for thi to work? How do i make it work??
Update
I was checking the yii.bat file contents:
#echo off
rem -------------------------------------------------------------
rem Yii command line bootstrap script for Windows.
rem
rem #author Qiang Xue <qiang.xue#gmail.com>
rem #link http://www.yiiframework.com/
rem #copyright Copyright (c) 2008 Yii Software LLC
rem #license http://www.yiiframework.com/license/
rem -------------------------------------------------------------
#setlocal
set YII_PATH=%~dp0
if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe
"%PHP_COMMAND%" "%YII_PATH%yii" %*
So it is saying: Yii command line bootstrap script for Windows
i don't understand about shell scripts, but the first thing that commes to my mind as obvious is that it wouldn't work on Linux, because it is a Windows command line tool.
The problem is i haven't found any source containing a Linux/Unix command line tool for Yii 2.0
Anyone knows where i can find it?
Or how do i make this run on Linux?
Thanks in advance
So guys, if you are uploading a Yii 2.0 windows project to a Linux server and need the command line tool to work, here's what you do:
Download on your server the template you are using (basic or advanced) using composer. Then you are gonna copy some files and replace it on your original project. They are:
composer.json composer.lock LICENSE.md README.md requirements.php yii
yii.bat
Probably you only need yii and yii.bat, but i replaced all the ones i've listed.

Nodejs is not available outside of its installation directory

I installed nodejs 64bit on my windows8.
NOTE: By install, I mean I used node-v0.10.35-x64.msi andn its Windows8 for SurfacePro3.
I am not familiar with add PATH. What exactly should add I add and how I run it after I added it?
However, nodejs will not be available outside of its own installation folder.
For example,
if I installed it at /www/test directory, then it will not available either in www or any level after test, like, /www/test/anothertest. Only /www/test will have node running.
I test it by write node -v on /www/test directory in command prompt. I consider its available when it returns me the node version number. When it is not recognized, it will say 'node' is not recognized as an internal or external command...'
I insta
Restart your computer always fix everything....
Yes it did now everything works lol

Cygwin and PHP Executable

In Windows, using Cygwin: How can I get the shebang line in a shell file to load the PHP interpreter?
I am using the prggmr library.
By default, in the shell file this is what I have
#!/usr/bin/php
And it works if I type this into Cygwin:
php c:/path/to/file
I have PHP and this Library setup in my environment paths so I can just type prggmr. So by typing "prggmr" it should work, but i keep getting
/cygdrive/c/lib/prggmr/bin/prggmr: /cygdrive/c/wamp/bin/php/php5.4.3:
bad interpreter: Permission denied
I have tried these with no luck, the same error as above:
#!/c/wamp/bin/php/php5.4.3
#!/cygdrive/c/wamp/bin/php/php5.4.3
If I'm reading your Paths right you have a Win32 PHP installed that you want to use with PHP. Normally, I'd say don't do it this way as things are going to get confused. Better to install PHP in Cygwin directly imo. There are a few resources out there, check out
this one for a good starting point.

Resources