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
Related
Ive been just starting to learn Symfony PHP framework, and Ive run into some problems with its configuration.
When trying to create a new project with command line like so:
symfony new --full my_project
I kept getting a simple error message:
no PHP binaries detected
and no files were created in the current folder. I searched on the net, and found out that Symfony apparently isnt able to find the location of my php.exe, despite it already being set in my system variables. And there was no information about how to properly configure this in Symfony.
How do I fix this error?
Turns out Symfony already contains functions to autodetect installed PHP versions from system variables. The command to fix the Symfony configuration is this:
symfony local:php:refresh
My next attempt to create a new project work fine after that.
Also, I suspect this error was the result of me installing PHP files after installing Symfony.
symfony local:php:refresh
doesn't always work. If your php is not in [/usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /usr/games /usr/local/games /snap/bin] and a few other locations (check with symfony local:php:list -vvv) then symfony won't find it.
I compiled my own PHP from source and installed versions 7.4.20 and 8.0.7 in /home/username/php/7.4 and /home/username/php/8.0. If I want to use my PHP 8.0.7, then I have to make a symlink because updating the $PATH doesn't help.
sudo ln -s /home/username/php/8.0/bin/php /usr/local/bin/php
This works and symfony finds it.
Follow below steps:
Step 1: download & Install xampp in your system
Step 2: open the xampp folder.
find php folder and hit enter
Step 3: copy the path and paste in your system environment
Step 4 : run
php -v
you are good to go!
I came from frontend stack so I can misanderstand something when I'm learning symfony3.
I downloaded Symfony according to documentation with:
php -r "readfile('https://symfony.com/installer');" > symfony
To make php command available i added some values to the enviroment PATH variable (according to this tutorial: https://seiler.it/installing-symfony-framework-into-xampp-for-windows/ - step 2.3) like this:
c:\xampp\mysql\bin;c:\xampp\php;c:\xampp\php\PEAR;C:\xampp\php\symfony
As you see I'm using xampp for PHP development. I added that last, because i copied that downloaded symfony file to c:\xampp\php\symfony directory.
OK, now if i want to use symfony command, like
symfony new project
I need to go to directory where there is that symfony file and add 'php' before, like
php symfony new project
Because simple 'symfony new project' doesn't work (error msg tells about that command isn't known by Windows). How can i fix it?
In frontend there is something like npm (node package manager) with which you can install library/tool locally in directory or globally (to run it in terminal from any place on the computer). Is there is any equivalent in PHP development? I tried to install this by pear (from mentioned tutorial in step 7), but it installed me symfony 1.x version (and error of running that command was that there is no task like 'new') and i want to learn 3, not 1.
I tried to get composer, but i don't see where can i install there symfony globally.
So, how to run symfony globally? What am I missing?
From this doc:
In Windows, move the symfony file to a directory that's included in the PATH environment variable to create the global command or move it to any other directory convenient for you
idea
Install and use Git Bash. Gives you more futures then the windows CLI.
Performance
To run a ten times more fast environment for Symfony i prefer a Linux OS.
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
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
How do I install Kohana v3.3.1 on Openshift? Do I create the PHP 5.3 cartridge and put the kohana files inside the php directory? Or do I create a Zend Server 5.6? I would like to use MySQL as well.
Kohana v3.3.1 requires PHP 5.3.3 or higher to work. I just created a PHP 5.3 Cartridge and git clone it to my harddrive and here is the file structure:
C:\mysite>ls -a
. .. .git .openshift README.md deplist.txt libs misc php
C:\mysite>
Inside the php directory
C:\mysite\php>ls -a
. .. health_check.php index.php
C:\mysite\php>
When I edited php\index.php to echo "Hello World" I was able to see Hello World in my browser at my Openshift address http://xxxx-xxxx.rhcloud.com/
Any assistance will be greatly appreciated!
EDIT 1
I listed the cartridges and discovered Do-it-Yourself 0.1
rhc cartridge list
Is this Do-it-Yourself 0.1 cartridge building what I need to do to get Kohana working on Openshift?
I would drop your code inside the basic php-5.3 application skeleton, and go from there.
You can add mysql to any application by listing it as a dependency during your rhc app create step, or by typing rhc cartridge add mysql from within your local project repo folder.
Once you get everything working, I would consider publishing the resulting repo to GitHub. This should allow others to spin up your openshift-compatible copy of Kohana by running:
rhc app create kohana php-5.3 mysql --from-code=http://github.com/YOUR_ACCOUNT/YOUR_PROJECT_NAME.git
(with YOUR_ACCOUNT and YOUR_PROJECT_NAME substituted into the above command)