Yii framework installation - php

I am new with yii framework. I have downloaded yii-1.1.14.f0fee9.zip file, I extracted and renamed it as yii and placed to my wamp root directory. For creating sample skeleton application, first I created test_project folder in wamp root and then run folling lines to cmd prompt.
cd c:\wamp\www\yii\framework
yiic webapp ..\test_project
these lines executed in cmd prompt without error. But, could it see create any sample or skeleton files under test_project folder. I have also tried to run it with browser. It showing blank. Anybody can please help me to start a skeleton project in yii ? Iam really interesting to develop projects in yii. please help me guys.

Follow the steps
cd c:\wamp\bin\php\phpx.x.xx
c:\wamp\www\yii\framework\yiic webapp c:\wamp\www\test_project
Note that in step 1. is your php directory that has php.exe file
Update:
For detail you can have a look at this link http://www.larryullman.com/series/learning-the-yii-framework/
This is a very good tutorial for Yii application initiation.
hope this will help

I've never used wamp but as I see it has a WWW directory. You should place your projects in this directory, otherwise it won't be available for browsers. (Never take the framework files here, just leave there than you placed before)
Using yiic. It is a command line tools (doesn't work from browser) for making skeleton app, migrations etc.
try:
cd (c:....... framework) [enter]
yiic webapp c:\......\www\test_project [enter]
The main are points the WWW and the separated command
I guess it will work.
Greg

Related

Laragon - How do I serve a website on startup?

Right now I have to open laragon start all > go into commands > and write php artisan serve, only then can I access the local website.
My question is how can I start all and serve the website on start of the program.
Thank you in advance!
you have to put your project folder into C:\laragon\www\
when start the laragon service it's gonna search in that folder and use the name of the folder project to create a custom url, for example
if you put your project folder named newproject into the C:\laragon\www folder, when you start the service, laragon it's gonna make an url with the name of that folder newproject.test
C:\laragon\www\newproject-> newproject.test
C:\laragon\www\blog-> blog.test

change laravel directory to www/cms/

Currently my directory is var/www/
but i have other projects in this directory .for example:
var/www/wordpress/
laravel tell me :
Sorry, the page you are looking for could not be found.
how can change laravel directory to var/www/cms ?
does work another project?
how can do that?
I commented earlier .. But I think to make the comment more clear I am going to go ahead and answer this:
First what you need to do is cd into /var/www/cms
Next you need to create your Laravel application. While in the cms directory, issue your Laravel creation command IE composer create-project laravel/laravel your-project-name. Once it is finished .. You should have a directory in the cms directory named whatever you named your Laravel Project IE var/www/cms/your-project-name.
You then need to point your hosts file (whether Nginx or Apache) to the directory var/www/cms/your-project-name for whatever domain.
I hope this was simplified enough for you, and good luck!
Laravel Valet could be one of the Solution.
You could create seperate Host for your Specific Application at Localhost.
Explained here : https://stackoverflow.com/questions/19425086/alias-hostname-for-localhost
You could Create new Directory and run your Laravel Project there too.

Unable to create web app in yii from console

I need to create a skeleton application in yiic from my console. I tried running the following command:
yiic webapp demo
My yii and frameworks folders are placed here:
C:\wamp\www\yii\yii-1.1.14.f0fee9\framework
My htdoc folder's path is here:
C:\wamp\bin\apache\apache2.4.9\htdocs
Can someone guide me here please? Thanks
The yiic.bat file needs to be edited. We have to provide the full path to our php.exe file placed in the bin folder.

Setting up preview of Yii2

The Yii2 preview was recently released and is available on github. I want to take it for a test drive, but the "documentation" so far gets outdated almost instantly since it is still under heavy development. I have tried to follow this guide on creating a simple CRUD app with Yii2, but it fails at the step:
php yiic.php app/create /var/www/yii2
With the error:
Could not open input file: yiic.php
Indicating that there is no file called yiic.php. The only folder within the framework folder is yii (framework/yii), and within that folder there is no file yiic.php, only Yii.php which when called in the command line gives the command list:
The following commands are available:
- asset
- cache
- help
- message
- migrate
Anyone managed to successfully setup a Yii2 app? Care to share how you got it done?
Seems like yiic has been removed for now, there are alternatives though, so read on.
It's all in the early stages, so the following method could break in the coming days/weeks/months. Therefore use with caution.
There are 2 ways to do this now:
Use composer. (I recommend this option.)
Directly copy the contents of yii2/apps/ directory to your apps directory, depending on the type of app you want to try.
There are currently 2 options for type of app - advanced, and basic. Both are in their respective directories within the yii2/apps/ directory, i.e yii2/apps/advanced and yii2/apps/basic.
For basic go through the basic readme.md, and for advanced go through the advanced readme.md.
The directions for using composer are given in the respective readme.md files. Including them here for completeness:
Basic app:
Install composer, if you don't have it.
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
Access app from http://localhost/my_yii2_trial/www
Advanced app:
Install composer, if you don't have it.
Use composer to install the app alongwith dependencies(Yii):
php path/to/composer.phar create-project --stability=dev yiisoft/yii2-app-advanced my_yii2_trial
According to readme, after step 2 app should be accessible, but composer was failing(see issue 439). With schmunk's tip, ran the install or install.bat command that gets copied by composer: ./install . Selected development environment (by entering choice 0 in the instructions that show up when running install command). Update: The command has been renamed to init, composer doesn't fail anymore, with fix from Qiang (check the issue 439 for more details).
Access app at: http://localhost/my_yii2_trial/frontend/www or http://localhost/my_yii2_trial/backstage/www
Here's how to copy the directory and get it working:
Basic app:
create your web-accessible directory for the app : my_yii2_trial
copy all files and folders from yii2/apps/basic/ directory to my_yii2_trial/ directory.
modify the my_yii2_trial/www/index.php file to point to the correct path for Yii.php.
For me it was within yii2/framework/yii/
comment the line that tries to include ../vendor/autoload.php file, I couldn't find that file anywhere, so its probably for some future use. it is the autoloader provided by composer.
Access from browser : http://localhost/my_yii2_trial/www
Advanced app:
create your web-accessible directory for the app : my_yii2_trial
copy all files and folders from yii2/apps/advanced/ directory to my_yii2_trial/ directory.
modify the my_yii2_trial/frontend/www/index.php file to point to the correct path for Yii.php. Similarly modify backstage/www/index.php.
comment the line that tries to include ../vendor/autoload.php file in both the index.php of backstage and frontend.
Access app at: http://localhost/my_yii2_trial/frontend/www or http://localhost/my_yii2_trial/backstage/www
Some important links to read more about this: issue 77, issue 108, issue 131, and wiki comment.
I am not sure how composer's autoloader is being used, so can't comment on that. Also in future versions, backstage might be renamed to backend.

zend framework : "A project profile was not found" zf version 1.11.7

I am trying to develop a project in zend framework. I have created a project gil using command line as follows then I entered to the project directory in command line and tried to create an action but I got an error as follows. I am using Windows XP and XAMPP and my Zend frameworks version is 1.11.7.
C:\xampp\htdocs\zframework12>zf create project gil
Creating project at C:/xampp/htdocs/zframework12/gil
C:\xampp\htdocs\zframework12>cd gil
C:\xampp\htdocs\zframework12\gil>zf create action add index
An Error Has Occurred
A project profile was not found.
Zend Framework Command Line Console Tool v1.9.0
Details for action "Create" and provider "Action"
Action
zf create action name controller-name[=index] view-included[=1] module
C:\xampp\htdocs\zframework12\gil>
Please help to sort out this issue
Thank you very much
In the second prompt, you type: cd gil . So, you'll move in the gil directory. This directory doesn't contain the zf xml file called .zfproject.xml (hidden). You should type:
zf create action add index
In the root directory: C:\xampp\htdocs\zframework12
I have the same problem, which caused by moving from one folders into another that lead to missing deleting hiden file .zfproject.xml. The solution is creating a new project "create project newname" and move all former files into this one.
Had the same problem with zf 1.12.9.
In my case, i was trying to execute command
zf1 enable layout from the parent dir to the project.
The solution was to go to the correct directory and then execute command.
This link helped me with my problem
original solution source
copy your zf.bat file to your new project 'gil' directory

Categories