I am trying to install zend on xampp and l am continuosly getting errors.
Firstly l am getting:
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in C:\xampp\htdocs\zend\ZendSkeletonApplication\public\index.php on line 24
Line 24 is as follows:
if (! class_exists(Application::class)) {
I solved this by making Application::class a string.
then l got the second error below:
Warning: include(C:\xampp\htdocs\zend\ZendSkeletonApplication\public/../vendor/autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\zend\ZendSkeletonApplication\public\index.php on line 22
Warning: include(): Failed opening 'C:\xampp\htdocs\zend\ZendSkeletonApplication\public/../vendor/autoload.php' for inclusion (include_path='.;\xampp\php\PEAR') in C:\xampp\htdocs\zend\ZendSkeletonApplication\public\index.php on line 22
Fatal error: Uncaught exception 'RuntimeException' with message 'Unable to load application. - Type composer install if you are developing locally. - Type vagrant ssh -c 'composer install' if you are using Vagrant. - Type docker-compose run zf composer install if you are using Docker. ' in C:\xampp\htdocs\zend\ZendSkeletonApplication\public\index.php:25 Stack trace: #0 {main} thrown in C:\xampp\htdocs\zend\ZendSkeletonApplication\public\index.php on line 25
where am l supposed to find the vendor folder with the autoload page? I would lie to solve to it today , lol, l have been attempting it for days unend.
Thank you in advance for your assistance
Using Composer is the recommended way to install Zend Framework (this creates the vendor folder). Personally I've never done this using Windows, but there are some instructions here which should help: https://docs.zendframework.com/tutorials/getting-started/skeleton-application/#windows-users-using-wamp
From the look of the first error message in your question, the version of PHP you're running is too low to run the current version of ZF, so you might need to upgrade PHP first. (Composer would normally tell you this during installation.)
Related
I have a problem with PhpStorm. I had trouble adding the Composer and Symfony commands to PhpStorm.
I receive a message of this style:
Problem Failed to parse output as xml: Error on line 2: Content is not
allowed in prolog.. Command php /root/Downloads/composer.phar list
--format=xml Output Fatal error: Uncaught Error: Class 'DOMDocument' not found in
phar:///root/Downloads/composer.phar/vendor/symfony/console/Descriptor/XmlDescriptor.php:90
Stack trace:
0 phar:///root/Downloads/composer.phar/vendor/symfony/console/Descriptor/XmlDescriptor.php(166):
Symfony\Component\Console\Descriptor\XmlDescriptor->getApplicationDocument(Object(Composer\Console\Application),
NULL)
1 phar:///root/Downloads/composer.phar/vendor/symfony/console/Descriptor/Descriptor.php(55):
Symfony\Component\Console\Descriptor\XmlDescriptor->describeApplication(Object(Composer\Console\Application),
Array)
2 phar:///root/Downloads/composer.phar/vendor/symfony/console/Helper/DescriptorHelper.php(69):
Symfony\Component\Console\Descriptor\Descriptor->describe(Object(Symfony\Component\Console\Output\ConsoleOutput),
Object(Composer\Console\Application), Array)
3 phar:///root/Downloads/composer.phar/vendor/symfony/console/Command/ListCommand.php(81):
Symfony\Component\Console\Helper\DescriptorHelper->describe(Object(Symfony\Component\Console\Ou
in
phar:///root/Downloads/composer.phar/vendor/symfony/console/Descriptor/XmlDescriptor.php
on line 90
Can you help me find the solution please ?
The version of PHP needs to be recent. On macOS by default you may end up with PHP 5.6, and PHPStorm actually choose /usr/bin/php as it's preferred option for commands.
I have a subdomain folder running on php 7. Globally my php version is 5.6 actually. When i run my project, i get a 500 internal error. Checking my error_log, i see this error
Fatal error: Call to undefined function Symfony\Polyfill\Mbstring\iconv_strpos() in /home/invoice/vendor/symfony/polyfill-mbstring/Mbstring.php on line 358
I tried to install this command composer require symfony/polyfill-icon in my subfolder (under the subdomain which is running on php 7) but then this is the result in the terminal
Warning: Ambiguous class resolution, "App\Http\Controllers\Auth\RegisterController" was found in both "/home/laravel/public_html/myproject/app/Http/Controllers/mNotify/Auth/RegisterController.php" and "/home/laravel/public_html/myproject/app/Http/Controllers/Auth/RegisterController.php", the first will be used.
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
Parse error: syntax error, unexpected '?' in /home/laravel/public_html/myproject/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 233
When i look in the vendor file in my subfolder under the subdomain, the
Symfony\Polyfill\Mbstring\iconv is installed there but when i test from the terminal using php --ir iconv, it get Extension iconv is not present.
What is happening?
check if mod php < 7.0 has enabled to disabled it.
and enable mod php 7 or 7.1
So i'm new in zendframework and i want to try zf version 1 , i cannot find a good documentation for this. i'm having an error when i try to run the downloaded file in xampp
here's the screen shot of my folder structure
I install zend framework using composer zendframework/zenframework
then here's the error
Warning: require_once(Zend/Application.php): failed to open stream: No such file or directory in D:\xampp\htdocs\Zend\public\index.php on line 17
Fatal error: require_once(): Failed opening required 'Zend/Application.php' (include_path='D:\xampp\htdocs\Zend\library;D:\xampp\php\PEAR') in D:\xampp\htdocs\Zend\public\index.php on line 17
you should read and understand step-by-step from here :
https://framework.zend.com/manual/1.11/en/learning.quickstart.create-project.html
Or,
https://framework.zend.com/manual/1.12/en/learning.quickstart.html
first try to understand the application structure.
As you are new in Zend framework, I think this is the best place to start.
I'm trying to use composer on my NAS (a good old D-Link DNS-323 running the incredibly good fonz fun plug 0.7).
I have my php installed in /ffp/bin/php.
When I install composer using the following command
php -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=/ffp/sbin --filename=composer
But when I do a simple less /ffp/sbin/composer, I have the following shebang set :
#!/usr/bin/env php
<?php
/*
* This file is part of Composer.
*
Unfortunatly, my NAS do not have the /usr/bin/env folder existing on my machine ...
So, how can I have composer referring to the correct php executable ?
Besides, I tried changing the declaration to use #!/ffp/bin/php, but when doing so, any composer run echoes the following result :
PHP Warning: PHP Startup: Unable to load dynamic library '/ffp/lib/php/extensions/no-debug-non-zts-20100525/gd.so' - File not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/ffp/lib/php/extensions/no-debug-non-zts-20100525/gd.so' - File not found in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/ffp/lib/php/extensions/no-debug-non-zts-20100525/sqlite.so' - File not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/ffp/lib/php/extensions/no-debug-non-zts-20100525/sqlite.so' - File not found in Unknown on line 0
PHP Fatal error: Uncaught exception 'PharException' with message 'phar "/mnt/HD_a2/ffp/sbin/composer" has a broken signature' in /mnt/HD_a2/ffp/sbin/composer:23
Stack trace:
#0 /mnt/HD_a2/ffp/sbin/composer(23): Phar::mapPhar('composer.phar')
#1 {main}
thrown in /mnt/HD_a2/ffp/sbin/composer on line 23
Fatal error: Uncaught exception 'PharException' with message 'phar "/mnt/HD_a2/ffp/sbin/composer" has a broken signature' in /mnt/HD_a2/ffp/sbin/composer:23
Stack trace:
#0 /mnt/HD_a2/ffp/sbin/composer(23): Phar::mapPhar('composer.phar')
#1 {main}
thrown in /mnt/HD_a2/ffp/sbin/composer on line 23
Of particular importance is the line
PHP Fatal error: Uncaught exception 'PharException' with message 'phar "/mnt/HD_a2/ffp/sbin/composer" has a broken signature' in /mnt/HD_a2/ffp/sbin/composer:23
How can i fix it ? In other words, how can I have a working php + composer installation on my NAS ?
So, how can I have composer referring to the correct php executable ?
A very simple solution is to create a shell script:
#!/bin/sh
/ffp/bin/php -n /ffp/sbin/composer "$#"
Make it executable, name it composer, put it in your path before /ffp/sbin (or rename /ffp/sbin/composer to composer.phar and update the above script too).
The -n flag tells PHP to not use php.ini. This is useful when there are many extensions loaded from php.ini; not loading them makes composer run faster. Especially xdebug is recommended to not be loaded by composer, for speed improvement.
I cannot run the composer command. I'm using windows cmd.
Inside C:\ProgramData\ComposerSetup\bin, I can do php composer.phar and it works.
But if do composer or composer.bat, I get this :
PHP Warning: Phar::mapPhar(/cygdrive/c/ProgramData/ComposerSetup/bin/c:\ProgramData\ComposerSetup\bin\composer.phar): failed to open stream: No such file or directory in /cygdrive/c/ProgramData/ComposerSetup/bin/c:\ProgramData\ComposerSetup\bin\composer.phar on line 23
PHP Fatal error: Uncaught exception 'PharException' with message 'unable to open phar for reading "/cygdrive/c/ProgramData/ComposerSetup/bin/c:\ProgramData\ComposerSetup\bin\composer.phar"' in /cygdrive/c/ProgramData/ComposerSetup/bin/c:\ProgramData\ComposerSetup\bin\composer.phar:23
Stack trace:
#0 /cygdrive/c/ProgramData/ComposerSetup/bin/c:\ProgramData\ComposerSetup\bin\composer.phar(23): Phar::mapPhar('composer.phar')
#1 {main}
thrown in /cygdrive/c/ProgramData/ComposerSetup/bin/c:\ProgramData\ComposerSetup\bin\composer.phar on line 23
What's wrong ?
I'm using the cygwin php in my path (cygwin/bin).
It works if I use a new php installation. But I want to keep "cygwin/bin" in my path.
I found it !
Removing "c:\cygwin64\bin" in the path.
Adding new php installation in path : "c:\php"
Adding new system variable : "CYGWIN_HOME", with value c:\cygwin64.
This way, using windows cmd, composer will use the php in the path ("c:\php").
And using cygwin, composer will use the php in "cygwin\bin" (because of the CYGWIN_HOME variable).