R
R
Roman Kozhevnikov2015-10-13 04:40:50
Yii
Roman Kozhevnikov, 2015-10-13 04:40:50

What to do with Parse error in Yii?

I installed composer, then Yii 2 basic, I go to localhost/basic/web/index.php I get Parse error: syntax error, unexpected T_OBJECT_OPERATOR in C:\openserver523\domains\localhost\basic\web\index.php on line 12
I go to localhost/basic/requirements.php getting Error
The path to yii framework seems to be incorrect.
You need to install Yii framework via composer or adjust the framework path in file requirements.php.
Please refer to the README on how to install Yii.
Warning: require_once(C:\openserver523\domains\localhost\basic/vendor/yiisoft/yii2/requirements/YiiRequirementChecker.php) [function.require-once]: failed to open stream: No such file or directory in C:\openserver523 \domains\localhost\basic\requirements.php on line 23
Fatal error: require_once() [function.require]: Failed opening required 'C:\openserver523\domains\localhost\basic/vendor/yiisoft/yii2/requirements/YiiRequirementChecker. php' (include_path='.;c:/openserver523/modules/php/PHP-5.3;c:/openserver523/modules/php/PHP-5.3/PEAR/pear') in C:\openserver523\domains\localhost\basic \requirements.php on line 23
The Yii-specific server has downloaded the latest version of Open Servera (5.2.3) from PHP version 5.3.29. I ran my PHP script on it to check, everything works. What to do?
By the way, there is no vendor folder that he is looking for for some reason (besides with dashes / in the wrong direction) does not exist, why is he looking for it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nazar Mokrinsky, 2015-10-13
@Most998

The server specifically for Yii downloaded the latest version of Open Servera (5.2.3) with PHP version 5.3.29

WHAT??? PHP 5.3 is already forgotten, PHP 5.4 is also not supported and never will be again.
The latest stable version of PHP is 5.6 and 7.0 is on the way.
Open Server contains PHP 5.6.12, switch in settings, return to the modern world from the stone age.
How did you install Yii 2 basic?
Then that everything that needs to be there, all dependencies. Try running composer install at the root (where composer.json is), this will create a vendor folder and download the necessary dependencies there.

P
Pavel Volintsev, 2015-10-13
@copist

The server specifically for Yii downloaded the latest version of Open Servera (5.2.3) with PHP version 5.3.29. I ran my PHP script on it to check, everything works. What to do?

Install a virtual machine with PHP 5.4+ and work in it if you are not going to replace Windows XP.
These are dependencies: the project includes the code of other projects, they are stored in different places and put together using the composer utility .
The backslashes are for Linux. Windows seems to understand them too.
Here is an example:
C:\>cd C:\Windows\
C:\Windows\>cd C:/Windows/
C:\Windows\>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question