I have just started with YII and I am trying to create a new migration. I am using Xampp and it is located in the d drive of my system.
The command that I am trying to use is:
D:\xampp\php> d:\xampp\htdocs\yii\framework\yiic migrate create create_project_table
When I run the above command nothing happens, neither do I get an error message nor there is any error.
I did manage to successfully create a shell by using
D:\xampp\php> d:\xampp\htdocs\yii\framework\yiic shell d:\xampp\htdocs\trackstar\index.php
I tried to search for any solution for the migration issue but they all seem to be linux based. Please let me know what I am missing here. Thanks for your help.
I managed to create the migration sucessfully. Turns out that I needed to use the yiic located in the protected folder of my application instead of the yiic located in framework folder of yii. The command that I used is
D:\xampp\php>D:\xampp\htdocs\trackstar\protected\yiic migrate create create_project_table
I have found that you need a forward slash in my version.
yii migrate/create <migration_name>
First you need to go to protect folder on your Yii project
Then run the comamnd:
php yiic migrate create create_new_table_name_table
Related
First of all I have just begun to tinker with Laravel 5 and php artisan, so don't judge to harsh please ;)
To get rid of ./public/index.php in the website path I did the following:
moved all the files in root/page_local/ folder;
moved files from public folder to root/page/;
modified the root/page_local/index.php file accordingly.
So the laravel works as it should now, but php-artisan is not. Every command that I try to run returns the same error:
[BadMethodCallException]
Method patter does not exist.
But I remember creating a Controller before and it worked, I tried multiple functions (--version, list, create::controller).
Even when I run composer update it errors when it tries to run php artisan clear-compiled.
I still managed to update the composer by running composer update --no-scripts
Please help me out on this one because I couldn't find any information regarding this issue on Laravel website and google. If you will need me to provide any of my code, let me know what you need and I will do so.
Thanks in advance.
Search your code for patter string, my guess is that you have a typo somewhere and the method is called pattern so use that instead. There is no patter method anywhere in Laravel code.
I am trying to make a script which automaticly loads a project from a git repository. I run exec() from a php file with name of the shell script as an argument. The script looks something like this:
git pull
php yii migrate
The git command works well, but the yii command is totally ignored. I'm doing this from the root of the directory of the yii site, so it should work, but it doesn't.
How can I fix this?
if you are using Yii version 1.x, you have to run your command from inside protected directory
cd protected
php yiic.php migrate
First of all, if you want to run console application in Yii2, just use
yii <route> [--option1=value1 --option2=value2 ... argument1 argument2 ...]
Second: yii migrate is the defined console command to upgrade a database to its latest structure. So it probably does its work, but not that you want to.
Try to rename your console command.
Reference links to read:
Guide: console commands
Guide: migrations (part with yii migrate).
I have installed Lavarel on my ubuntu system by going through this link. After all the steps I can see the laravel default page(You have arrived). I came to know about the laravel command tool. So inside laravel folder from command tool(terminal) I tried
php artisan serve
and it showed me like this
Laravel development server started on http://localhost:8000
Directory does not exist.
When I used http://localhost:8000 from the browser it showed me like This webpage is not available. So can someone tell me how to solve this? Any help and suggestions will be really appreciable. Thanks
This is caused when Laravel cannot find public/index.php. You might need to update boostrap/paths.php to reflect your current public path.
In bootstrap/paths.php, change
'public' => __DIR__.'/public',
to
'public' => __DIR__.'/../',
*(Assuming there's a good reason for butchering the base install, such as deploying on IIS)
Reinstall it and skip the part when you remove public folder. It's a good security feature to have your public folder separated from your application code.
I'm attempting to build a test project with the Zend framework and using MAMP to run it on my local host.
The project creation works fine; I navigate to my htdocs directory and use zf create project my_zend to create the scaffold.
My error comes when I try to create a controller "students" by using the following command zf create controller students, however, once this command runs it outputs the following error:
Context by name servicesDirectory does not exist in the registry.
Where does this error come from?
I had the same problem, here is how I fixed it, check for the line:
<servicesDirectory enabled="false"/>
In the .zfproject.xml file and remove it.
You might get this error if you have another version of zend some where in the path. If you have one try deleting it and using the latest or the version you wish to. This worked for me in xamp on windows 7 hope it works for you
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