I am having trouble getting the Bake console.
I am on Windows running XAMPP.
I'm doing the IBM CakePHP tutorial.
Here is my directory:
C:\
xampp
htdocs
ibm2 (a test project - orginally called cakephp)
app
cake
vendors
(etc)
It says to use Bake,
cd into the /webroot/app directory and
launch the Cake Console:
../cake/console/cake bake. You should
be presented with a screen that looks
like Figure 2.
So I write in my command prompt till I am at:
C:\xampp\htdocs\ibm2\app>
Then I type
../cake/console/cake bake
but I get this error:
'..' is not recognized as an internal
or external command, operable program
or batch file.
What am I doing wrong? I use the Windows command prompt
Take a look at Setting Up the CakePHP Console on Windows screencast.
start the command prompt:
type cd\ press enter and then cd:/xampp/php press enter
php.exe C:/xampp/htdocs/cakeblog/lib/cake/console/cake.php bake press enter
This trick works for me :-
Go to shell folder which is in bin folder in cakephp 3.0.
Click on batch file.
After it open cmd and set path to your folder like cd xampp/htdocs/test and then enter bake commands
In cakephp 3.X bake and windows environment with wamp server you should have yet php environment variable active:
check with Powershell and type php-v if you see your version of php
Install cake php bake https://book.cakephp.org/bake/1/en/index.html
no need to install cakephp environmetn variable only go to the root folder on your project and type: PS C:\wamp64\www\yourcakephp3.x_project>bin/cake bake
first check bake command in command prompt if it gives the out put not recognized as
internal or external command than first add environment variable correctly than cake bake will
work correctly
Related
How to make a shortcut that is doubled clicked and it run the laravel project automatically.
Manual process
what we do to run a Laravel project:
First of all we open the terminal(mac) or cmd (windows), then in the terminal we type the following command in order to reach the location where the laravel project is.
cd <your project location>
After accessing the project folder, we type the following command to run the project.
Php artisan serve
I want the whole process is done by a single shortcut, is it possible?, if yes, kindly help me up.
You can follow this by making shorcut, with your commands that you want to trigger.
For more help you can click on the below link:
https://www.howtogeek.com/277403/how-to-run-command-prompt-commands-from-a-windows-shortcut/
steps:
Create a shortcut by right-clicking anywhere in File Explorer or your desktop and choosing New > Shortcut.
In the Create Shortcut window, type your command using the following syntax:
"C:\Windows\System32\cmd.exe" /k yourcommand
The first part (the part in quotes) just calls cmd.exe to open the Command Prompt. The switch /k tells Command Prompt to issue the command that follows, and then stay open so that you can view results or type followup commands. You can also use the /c switch instead /k (use only one of the switches) if you want the Command Prompt window to close after issuing the command. And of course, the yourcommand part is the actual command you want to run.
"C:\Windows\System32\cmd.exe" /k cd yourProjectFolder & php artisan serve
In windows, like said before, you can create a bat script. Open notepad, write something like the following and save as "something.bat".
#echo off
Rem Change Directory to your project
cd C:\<your project directory>
Rem Run Artisan Command
php artisan serve
Then, doble click your bat file.
There is a much easier way, you could refer to this package called Laravel Valet (https://laravel.com/docs/8.x/valet), this is a package that you could install to your project folder and all laravel projects in that folder can be run automatically by entering the [project name].test in the browser once Laravel Valet is configured and started. For example, if you have a project in the folder where valet is installed, you could enter demo.test in your browser and then the project will be loaded automatically
Go and right click on your mouse or touch pad, make a shortcut, and then add command
commmand "C:\Windows\System32\cmd.exe" /k cd rootfolder & php artisan serve
I'm using a vagrant box for my php project. I've created two .env files (.env and .env.testing). The website runs smoothly but while testing the functions using PHPUnit, it throws me a File Not found error. I can see the files on my directory but can't view them in terminal using ls. But I can see them all if I use ls -a command. Is the issue with vagrant or putty or am I doing this wrong?
I uploaded my project to a server running Ubuntu. The project has a console command logrotation/index. I want to run it through the command line, and Ubuntu says "yii: command not found". I tried to run it in different ways.
How to run this console application from the command line and then (for the future) put it as a cronjob?
Inside project directory:
./yii logrotation/index
Or
php yii logrotation/index
The error message "yii: command not found" means that Ubuntu can't find the binary in $PATH directories. So you need to specify ./ to show that you are executing a file from the current directory.
I have installed Symfony2 on a Xampp server with PHP 5.3.8 and everything works ok ( the php, the symfony demo page ).
I try to create my own helloWorld, as the tutorial says :
php app/console generate:bundle --namespace=Acme/HelloBundle --format=yml
I go Start->Run->CMD and put that line of code and it gives me back this :
could not open input file : app/console
I put the PHP directory to the System PATH but the problem persists.
To execute command you should move to root directory of your project in terminal/CMD.
Please note that in version 2.5 some changes has been made so command will not work with app/console
Note: From 2.5 app/console is replaced by bin/console.
Please check here for changes. Also check this for more details about difference.
Most probably, you're not in the symfony2 project directory.
start the windows console as you're doing it (Start->Run->CMD)
then move to the symfony2 project root directory with the command cd:
"cd c:\htdocs\path\to\your\symfony2\project"
then run the command from the tutorial
the thing is that the part of the command from the tutorial "app/console" means the path to the "console" script in the "app" directory of the symfony2 project.
On MAC OS X Lion - Running MAMP
I'm trying to execute the following yiic command (from Yii framework);
./yiic message ./app/messages/config.php
I'm getting this message:
env: php\r: No such file or directory
I've looked into yiic file and I see:
#!/usr/bin/env php
<?php
require_once(dirname(__FILE__).'/yiic.php');
I've looked into /usr/bin/env
and I see, nothing related to php (I believe):
Should I have there something related with php ?
TERM_PROGRAM=Apple_Terminal
TERM=xterm-256color
SHELL=/bin/bash
TMPDIR=/var/folders/qq/4k5m37mn16bgfpp6yt8ggljc0000gn/T/
Apple_PubSub_Socket_Render=/tmp/launch-L43tVY/Render
TERM_PROGRAM_VERSION=299
TERM_SESSION_ID=1999B4D4-939B-4065-B71C-D9B0563A9EC6
USER=mem
COMMAND_MODE=unix2003
SSH_AUTH_SOCK=/tmp/launch-FBmmga/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:0:0
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin
PWD=/usr/bin
SHLVL=1
HOME=/Users/mem
LOGNAME=mem
LC_CTYPE=UTF-8
DISPLAY=/tmp/launch-oXxXFl/org.x:0
_=/usr/bin/env
OLDPWD=/usr
As anyone add this error before?
Is this something to do with the fact that php is not on that env think perhaps?
Please advice
It looks you're just experiencing an encoding issue with your yiic file. The shell is trying to use php\r interpreter to open yiic, instead of php.
Run the following command to replace all CARRIAGE_RETURN characters by LINE_FEED :
perl -pi -e 's/\r/\n/g' yiic.php
Worked pretty well in my case.
I just read this blog: could be the very same problem you are experiencing?
The next step is to tell the yiic application, found in the framework folder, to create a new site. The syntax is
yiic webapp path/to/directory
But before you even begin to use this command, let me explain it a bit, as it’s very important and can be complicated. The yiic file is an executable that runs using the computer’s command-line PHP and that really just invokes the yiic.php script. You may be able to call it using just yiic or using ./yiic (i.e., run the yiic command found in the current directory). Or you can more explicitly call either script using php yiic or php yiic.php. Or you may need to indicate the PHP executable to be used: C:\php\php.exe yiic. You should try the variations on this command, as applicable to your computer, just to make sure you can invoke yiic, prior to trying to create the Web application.
In my case that worked for using xampp:
Creating new project:
X:\xampp\php>php.exe X:/xampp/htdocs/yii/framework/yiic webapp X:/xampp/htdocs/YOUR_PROJECT
yiic shell:
X:\xampp\php>php.exe X:/xampp/htdocs/YOUR_PROJECT/protected/yiic shell X:/xampp/htdocs/YOUR_PROJECT/index.php
Just I changed php version of my system form 4 to 7.
I run this command to salve this issue-
source ~/.bash_profile
This solved my issue.