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
Related
I have tried to install the Symfony 4 on my Macbook Air by using Composer. I have used the below commands for installing and running Symfony application
composer create-project symfony/website-skeleton symfony4
cd symfony4
composer require server --dev
php bin/console server:run
And then tried to access the application in http://127.0.0.1:8000/. Below is the error message
Below image shows the error in which line and file
I am using PHP 7.2.3 and installed by using Homebrew. At the same time when I use the below command to install, Symfony welcome page appears without any error.
composer create-project symfony/skeleton symfony4
There is no default welcome page when you create new symfony flex application and there is an issue and a pull request already.
Everything is working fine you just don't have any pages.
Here you can read how to create a symfony page: https://symfony.com/doc/current/page_creation.html
I am new in symfony 3.0. I want to integrate ACL in my project.I am using following environment.
Symfony 3.0
OS: Windows
I did follow below link:
http://symfony.com/doc/current/cookbook/security/acl.html
When I run this command: php bin/console init:acl
I am getting following message:
[LogicException]
You must install symfony/security-acl in order to use the ACL functionality
Can anyone suggest how I can integrate it? Is there any demo URL and from where I can download the code?
You are missing a package that Symfony needs in order to activate ACL on your project.
To install such packages, you'll need to have a working Composer installation (Composer is a PHP dependency management scripts you can use to manage packages): see https://getcomposer.org/download/
Once Composer is running, you can open a console and go to the root of your project. There you can run the following command line option:
composer require symfony/security-acl
followed by:
composer update
Now you should be able to run the php bin/console init:acl command successfully.
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
I have a hosting service in linux, where I’m trying to develop an app on zend framework 2. I want to use zftool but regardless which zftool command I run, I get always the HTML of the home page.
I’ll really appreciate any help.
Here are the steps to reproduce:
1 - I installed composer
>curl -s https://getcomposer.org/installer | php
2 - I installed the Skeleton MVC application
>php composer.phar create-project -sdev --repository-url="https://packages.zendframework.com" zendframework/skeleton-application ./hmzf
3 - Brought Composer up to date
>php composer.phar self-update
4 - Install ZFTool
>php composer.phar require zendframework/zftool:dev-master
5 - Createa symbolic link to invoke it from my project directory
>ln -s ./vendor/zendframework/zftool/zf.php zf.php
6 - Run zf.php to get the list of modules and what I get in return is the html of the home page of the skeleton app:
> php zf.php modules
I found the issue. I had to use php-cli to invoke zf.php. So instead of issuing:
php zf.php modules
which will echo the zend app home page HTML to the console, I had to issue:
php5.4-cli zf.php modules
and I've got the right response from the tool, which is:
Modules installed:
Application
i am trying to install yii 2 and to run the basic or advanced application.
i have tried the steps given here Setting up preview of Yii2 to do this.
the steps i followed,
1 - Installed the composer
2 - Use composer to install the app alongwith dependencies(Yii): php path/to/composer.phar create-project --stability=dev yiisoft/yii2-app-basic my_yii2_trial
3 - Access app from http://localhost/my_yii2_trial/web
The problem is, i am getting this syntax error.
Parse error: syntax error, unexpected '[', expecting ')' in D:\xampp\htdocs\my_yii2_trial\vendor\yiisoft\yii2\yii\Yii.php on line 25
can any body help to resolver this issue pls
Yii2 has started using PHP 5.4's Short array syntax. Your error creeps up because of:
spl_autoload_register(['Yii', 'autoload'], true, true);
in Yii.php, which is the new short array syntax. As you have already figured out, you need to install PHP 5.4 now to run Yii2 apps.
The commit which made the changes to short array syntax.
The docs and composer details that have been changed.
The discussion where the decision to move to PHP 5.4 was made.
As Yii2 is still in heavy development, its requirements are also changing. So be sure to read the readme thoroughly before installing.
See also the Backward Incompatible changes list for PHP 5.4, to make changes to your existing code.
Install PHP 5.4 to resolve this issue.
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
Here is command lines to install yii2 on ubuntu:
cd /var/www
/var/www$ ls
/var/www$ cd myyii2
/var/www/myyii2$ ls
/var/www/myyii2$ ls -al
/var/www/myyii2$ ls
/var/www/myyii2$ php init
/* Your choice [0-1, or "q" to quit] 0*/
choose 0 for developemnt and type yes
php yii migrate (/var/www/myyii2$ php yii migrate)
Before this command need to download advance setup like [yii-advanced-app-2.0.7.tgz]