PHP YII framework Error: Unknown command "webapp" - php

I am trying to install Yii framework on windows XP in XAMPP. I am getting this error
Error: Unknown command "webapp".
I am using this command
yii webapp ../../myprojct
I have set the path as
SET PATH=D:\xampp\php
I am using the Yii 2

There is no webapp command anymore in yii2. Creating a project is done with composer create-project --prefer-dist yiisoft/yii2-app-basic basic.
Please refer to the official guide for instructions.

Download yii2 file from Yii2 Framework website and extract it htdocs.
then open the command prompt, use cd command to map the folder directory and finally use this command to install this
htdocs/foldername>php init
I hope this will help you, Thank You

Related

create new web application in yii 2 advanced

I just started to try yii php framework, i have followed all the installation tutorial and I can run the yii framework, but i got stuck when I wanted to create a new web application by using command prompt.
the following command is like
cd c:\xampp\pathtoyii\framework
then
yiic webapp newWebAPP
the problem is in my yii folder doesn't contain framework folder and yiic file that i must write in the following command. anyone know this issue?
here is my yii folder root
no framework folder there.
actually, I need a path like this
and this is the framework folder.
is there any different in new version of yii that I installed?
So the issue here is you are mixing Yii1 and Yii2. If the tutorial you are reading references "yiic", that is Yii1, not Yii2. The framework folder you show also is from Yii1.
I'm not sure if you are trying to write a Yii1 or Yii2 app. If Yii2, check out the instructions for setting up a new app here: http://www.yiiframework.com/doc-2.0/guide-start-installation.html If Yii1, here: http://www.yiiframework.com/doc/guide/1.1/en/quickstart.installation
They are very similar, but are fundamentally different frameworks as Yii2 is NOT backwards compatible.
Read the installation guide!
First, you must install a composer.
Than, require asset plugin:
composer global require "fxp/composer-asset-plugin:~1.1.1"
and install project:
composer create-project --prefer-dist yiisoft/yii2-app-advanced yii-application
Yii2 Installation Following command:
(1) First install Composer (LINUX):
Locally:
curl -sS https://getcomposer.org/installer | php
OR
(1) First install Composer (WINDOWS):
C:\Users\username>cd C:\bin
C:\bin>php -r "readfile('https://getcomposer.org/installer');" | php
Note: If the above fails due to readfile, use the http url or enable php_openssl.dll in php.ini
C:\bin>echo #php "%~dp0composer.phar" %*>composer.bat
C:\Users\username>composer -V
Composer version 27d8904
(2) Yii2 framework online downloads:
Basic App:
php composer.phar create-project yiisoft/yii2-app-basic basic 2.0.0-beta
Advanced App:
php composer.phar create-project yiisoft/yii2-app-advanced advanced 2.0.0-beta
(3) Other App Settings Command:
php init
php yii migrate

bash: laravel: command not found

I am Using my own Machine Kali Linux 2.0 Debian x64 . Now, i have Installed Laravel in my directory structure like
/opt/lampp/htdocs/learning-larvel/
Inside the Learning-laravel folder i have Installed my Laravel files, and also i installed composer. So when i go to http://127.0.0.1/learning-laravel/public . I see a See a White Screen and in Between it is written "Laravel 5", which means the Laravel GUI Setup is fine.
Now, to create a new file for Laravel, when i open my Terminal and type
laravel new xyz
then it gives me a error which says bash: laravel: command not found
Now, how can i fix the error.. I have researched about it by setting PATH to bashrc. But i am not getting it fixed right. Additionally when i type in my command composer -version then also it says bash: composer: command not found but i have Installed composer on the folder learning-laravel itself.
I could also see files like composer.phar there in /opt/lampp/htdocs/learning-larvel/
Any help would be extremely thankful.
As the composer official getting started page points out:
There are in short, two ways to install Composer. Locally as part of
your project, or globally as a system wide executable.
if you wanna do composer -- or laravel -- in command line, you wanna install them globally.
Check out the following links:
https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx
https://laravel.com/docs/4.2#install-laravel
I encountered the same problem. Apparently, the composer exists in path ~/.config/composer/vendor/bin when running as super user. Therefore, replacing the paths which were described above by this, and it should work. Hope it helps.

error using composer to install cakePHP 3

i am lost...
i am trying to do it the right way and am following the Quick Start Guide for installing cakePHP 3 on my ubuntu machine.
Got composer installed. Directory is /var/www/cakephp
and am trying to issue:
php composer.phar create-project --prefer-dist cakephp/app mayapp
or
composer create-project --prefer-dist cakephp/app may app
then i am simply getting:
[InvalidArgumentException]
Could not find package cakephp/app with stability stable.
i do not have a clue what i am doing wrong. Any suggestions?
cakephp/app exists on https://packagist.org, and the command looks ok to me.
Which PHP version are you using? That package is only available with PHP 5.4.16 or later, so you must update if you want to use CakePHP.
However, it is a good idea to only use the same PHP version of your public hosting, using a newer version will lead to problems when deploying your code. If your webspace or public server does not have the latest PHP 5.6 running, ask for an update.
I got same issue. But, as previous answer, myapp does not exists on packagist.org, so, you must use laravel/laravel instead, and, after created, rename the new laravel folder to your desired name and move to htdocs (for xampp) or www (for wamp), then, and I do not know why, go to : localhost/laravel/public/
and replace laravel with the name you gave to your project folder instead the laravel one.
You will see Laravel 5 fonts will appear on screen.
That's means Laravel is running.
Hey Please try these steps.
Download XAMPP Server.
Install XAMPP server.
Go to ..\xampp\php\php.ini and open.
Add this line (extension=php_intl.dll) or if exist uncomment.
Download Composer setup from https://github.com/composer/windows-setup/releases/
Install composer and give php.exe file in path
Open cmd and check now php version using command php -v. if its showing php version its means its working.
Now open cmd and cd on xampp\htdocs folder & run command composer create-project --prefer-dist cakephp/app app_name
Finished folder created in htdocs.
Hope this is helpful for you.

zend framework2 installation

I am trying to installing the library of the zend framework2.I have downloaded the skeleton application of zend framework2 and run the command in command prompt as in the zend framework installation guide on zend site but i am getting an error
it shows me an error could not open input file composer.phar
I checked the library which i have downloaded from git there is no composer.phar.There is only composer.json and a lock file of composer.I google out about this problem and find that it is due to open_ssl exention is disable in php.ini file.I checked the php.ini and found enabled.I am still getting the same error.
Regards to the official documentation for the skeleton application here
Github documentation it says
The easiest way to create a new ZF2 project is to use Composer. If you don't have it already installed, then please install as per the documentation.
with the documentation here
Composer documentation
And the Composer website here
Plus, from your screen behind your cmd line we can see this line taken from the website you show :
ZendSkeletonApplication is set up to use Composer (http://getcomposer.org) to resolve its dependencies. In this case, the dependency is Zend Framework 2 itself.
Composer is a soft his name is called composer.phar. It is what your looking for
go to C:\ProgramData\ComposerSetup\bin using command prompt then run composer cammands

ZFTool2 - Error Creating Project

I am new to the Zend Framework. I just started using ZFTool 2. The documentation says I can create a project by running the command
zf.php create project <path>
When I try to create a project
C:\wamp\www>zf.php create project quickstart
I encounter the following error
Error: I cannot find the autoloader of the application.
Check if C:\wamp\www contains a valid ZF2 application.
All other commands seem to work fine except the above. I wouldn't expect the command to be trying to find the autoloader of the application in my www folder anyway escpecially because am attempting to create a new project
EDIT:
The same thing also happens when i run the command
C:\wamp\www>zf.php version
When you use composer to install zftool then it will auto install into vendor\zendframework\zftool
So that, you only need cd to root of application and then point to folder ztool(example: your application folder that store in c:\xampp\htdocs\zend)
c:\xampp\htdocs\zend> php ./vendor/zendframework/zftool/zf.php version
It will output bellow:
ZFTool - Zend Framework 2 command line Tool
The ZFTool is using Zend Framework 2.5.1
and it'll work for you.
http://rao5s.vn

Categories