ZendSkeletonAplicaton giving me errors - php

I am trying to int Zend framework 2. I aready have xampp running. I followed the steps on this answer. How ever when I visit the url I specified I get the following descriptive error:
Fatal error: Uncaught exception 'RuntimeException' with message 'Unable to load ZF2. Run php composer.phar install or define a ZF2_PATH environment variable.' in C:\xampp\htdocs\ZendSkeletonApplication\init_autoloader.php:51 Stack trace: #0 C:\xampp\htdocs\ZendSkeletonApplication\public\index.php(18): require() #1 {main} thrown in C:\xampp\htdocs\ZendSkeletonApplication\init_autoloader.php on line 51
as the exception states. I went on to run the command php composer.phar install
and nothing happens. nothing displays on th cli to showing anything being installed. and when i run again application i get the same error. Where else can I look and check for errors. Thanks
I am using PHP Version 5.6.8

So what worked for me. I began again from scratch following the tutorial here
Then I still got a "could not open input file: composer.phar" when I ran the command: php composer.phar install
so according to "www.softanalyst.com/zend-2-framework-installation-with-xampp/#comment-883" I need to run the following command:
php -r "readfile('https://getcomposer.org/installer');" | php
which I did and it all worked.

open up your terminal and move To your project using the cd project directory
one type dir composer.phpr and try this one dir composer.json if both file listed than do the next step otherwise download the composer in current directory and run the following command as bellow.
php composer.phar install this comman will install all required dependency from the composer.json file. it will take time as depend on internet speed.
once it's complete than try this link for further steps.this link also having how To install composer And skeleton application.
Github
Twitter

Related

I can't run project from localhost

I have a project that I need to edit. To see this project, I wanted to run it on localhost and ran it from wamp. Later, when I entered localhost, I got the error.
On top of that, I wanted to run it from cmd and see it. The response I got at that time was as follows.
Fatal error: Uncaught Error: Failed opening required 'C:\wamp64\www/vendor/autoload.php' (include_path='.;C:\php\pear') in C:\wamp64\www\artisan:18
Stack trace:
#0 {main}
thrown in C:\wamp64\www\artisan on line 18
check if there is any /vendor/autoload.php file in your wamp folder if not try composer install in the terminal where your project is located. (if you don't have composer install the composer first via this url)
you can start your project directly with php artisan serve too. if php is added to your windows path variables.

Uncaught Runtime Exception : Unable to load ZF2 Run `php composer.phar install`

When I try to run my project in localhost I am getting the above error.
The thing is I already installed the composer. In terminal I get the confirmation saying
Composer (version 1.4.2) successfully installed to: /home/martin/composer.phar
Use it; php composer.phar
Even I tried the command composer It is showing the Composer things.
What should I do to get rid of the error Fatal error : Uncaught Runtime Exception ....
For this issue you need to change php files.
1.php.ini
You can add the Zend Framework’s library path to the PHP include_path.
You can find include_path in php.ini.
Example #1 Unix include_path
include_path=".:/php/includes"<br>
Example #2 Windows include_path
include_path=".;c:\php\includes"
2.httpd.conf
You should set an environment path named ‘ZF2_PATH’ in httpd.conf (or equivalent). i.e. SetEnv ZF2_PATH /var/ZF2 running Linux.

How can I fix this composer.phar install error in Windows 10?

I've been googling this for half an hour and nothing's working. I've got PHP added to my windows path variable, and everytime I run this:
php composer.phar install --no-dev --optimize-autoloader
I get this
Fatal error: Uncaught exception 'PharException' with message 'unable to open phar for reading "composer.phar"' in composer.phar:23
Stack trace:
#0 composer.phar(23): Phar::mapPhar('composer.phar')
#1 {main}
thrown in composer.phar on line 23
I'm CD'd into the folder it's in, I've tried specifying that folder in the command, nothing's working, neither does
php -r "readfile('https://getcomposer.org/installer');" | php
edit: Ok I signed out and back in after trying the windows exe installer, seems it's installed now but only globally, I still don't have the vendor/bin directory I need in my specific project, still fails when I try and run php composer.phar install

Getting [ErrorException] - installing yii2 using composer

I am trying to install Yii2 on WAMP using composer.
c:\Users\username>php composer.phar create-project yiisoft/yii2-app-basic basic 2.0.0
I am getting the following error when I run the command which is given above.
[ErrorException]
Argument 1 passed to Fxp\Composer\AssetPlugin\Repository\BowerRepository::createVcsRepositoryConfig() must be of the type array, null given, called in C:\Users\username\AppData\Roaming\Composer\vendor\fxp\composer-asset-plugin\Repository\AbstractAssetsRepository.php on line 136 and defined
Can someone help solving this error? But, it is created a folder named "basic".
I have copied this folder to D:\wamp\www and when I access localhost/basic/web/ from browser, I am getting the following error.
ReflectionException
Class yii\debug\Module does not exist
I am following the instructions to install yii2 from http://www.yiiframework.com/download/
Please assist me to resolve these issues.
Thanks
First windows does not have a curl processor like unix so you need to use the other option for installing Composer
php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"
For this to work you need the php.exe processor to be on your path, so you have 2 options here. Either add the c:\wamp\bin\php\phpx.y.z folder to your PATH or my prefered option write yourself a little .cmd file which will do it for you like this
addphp.cmd
PATH=%PATH%;c:\wamp\bin\php\phpx.y.z
Put this file in a folder already registered on your path so you can run it from anywhere in a command window.
Now you will have to edit the \wamp\bin\php\phpx.y.z\php.ini file. This is similiar to the one used by php code run through the Apache web server but is only used by the PHP CLI (Command Line Interpreter)
Make sure the extension php_curl is uncommented or the above line wont work i.e. remove the ; comment symbol
extension=php_curl.dll
So now run a command window, cd into the folder that you want composer installed into and run the command above, then follow the rest of the install instructions on Install instructions
EDIT: Thank you for reminding me.
This error happens because of invalid json on plugin you or application requested (npm or bower).
The link here suggests you to run:
composer global update.
This will update composer cache. Hope it helps.

zf.php: command not found ubuntu 12 Zendframework

I have downloaded and extracted the ZendSkeletonApplication as said in the
http://framework.zend.com/manual/2.2/en/user-guide/skeleton-application.html
Now when the try installing the zftool by follwing the document
1.http://framework.zend.com/manual/2.1/en/modules/zendtool.introduction.html
when typed
composer require zendframework/zftool:dev-master
i got Error:
No command 'composer' found, did you mean:
Command 'compose' from package 'mime-support' (main)
composer: command not found
So tried Manual installation
Extracted and placed as said in manual
i have installed the ZFTool here:
/var/www/ZendSkeletonApplication/vendor/ZFTool
This also says Error:
zf.php: command not found
Not sure what else is creating problem.
Can you guys, please provide with a step by step way of installing zftool
Place yourself in the root of the project
On Linux run command find -name zf.php just to find the location of the file under your project.
If you find it - mine was under vendor/bin, run the following command:
php vendor/bin/zf.php create module Test
This command will create the Test Module.

Categories