-2

I have installed cakephp using composer. But while running it showing the following error.

Warning: require(D:\xampp\htdocs\my_app_name/vendor/autoload.php): failed to open stream: No such file or directory in D:\xampp\htdocs\my_app_name\webroot\index.php on line 27 Fatal error: require(): Failed opening required 'D:\xampp\htdocs\my_app_name/vendor/autoload.php' (include_path='D:\xampp\php\PEAR') in D:\xampp\htdocs\my_app_name\webroot\index.php on line 27

Could you please help me ?

 
Lenovo-User@Lenovo MINGW64 /d/xampp/htdocs
$ composer self-update
You are already using composer version 1.4.2 (stable channel).
 
Lenovo-User@Lenovo MINGW64 /d/xampp/htdocs
$ composer create-project --prefer-dist cakephp/app mylogin
Installing cakephp/app (3.4.2)
  - Installing cakephp/app (3.4.2): Loading from cache
Created project in mylogin
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
 
  Problem 1
    - cakephp/cakephp 3.4.9 requires ext-intl * -> the requested PHP extension i
ntl is missing from your system.
    - cakephp/cakephp 3.4.8 requires ext-intl * -> the requested PHP extension i
ntl is missing from your system.
    - cakephp/cakephp 3.4.7 requires ext-intl * -> the requested PHP extension i
ntl is missing from your system.
    - cakephp/cakephp 3.4.6 requires ext-intl * -> the requested PHP extension i
ntl is missing from your system.
    - cakephp/cakephp 3.4.5 requires ext-intl * -> the requested PHP extension i
ntl is missing from your system.
    - cakephp/cakephp 3.4.4 requires ext-intl * -> the requested PHP extension i
ntl is missing from your system.
    - cakephp/cakephp 3.4.3 requires ext-intl * -> the requested PHP extension i
ntl is missing from your system.
    - cakephp/cakephp 3.4.2 requires lib-icu >=4.8 -> the requested linked libra
ry icu has the wrong version installed or is missing from your system, make sure
 to have the extension providing it.
    - cakephp/cakephp 3.4.1 requires lib-icu >=4.8 -> the requested linked libra
ry icu has the wrong version installed or is missing from your system, make sure
 to have the extension providing it.
    - cakephp/cakephp 3.4.0 requires lib-icu >=4.8 -> the requested linked libra
ry icu has the wrong version installed or is missing from your system, make sure
 to have the extension providing it.
    - Installation request for cakephp/cakephp 3.4.* -> satisfiable by cakephp/c
akephp[3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.4.4, 3.4.5, 3.4.6, 3.4.7, 3.4.8, 3.4.9].
 
  To enable extensions, verify that they are enabled in your .ini files:
    - D:\xampp\php\php.ini
  You can also run `php --ini` inside terminal to see which files are used by PH
P in CLI mode.
 
Lenovo-User@Lenovo MINGW64 /d/xampp/htdocs
$
 

Thanks,

  • 1
    can you tell us Cakephp version? – Sehdev Jul 03 '17 at 09:08
  • @ÁlvaroGonzález CakePHP 3.4 –  Trishna Jul 03 '17 at 09:11
  • @Sehdev I think it is the latest version cakephp 3.4 –  Trishna Jul 03 '17 at 09:12
  • @ÁlvaroGonzález I just used the below command - php composer.phar create-project --prefer-dist cakephp/app my_app_name –  Trishna Jul 03 '17 at 09:13
  • @ÁlvaroGonzález now i tried a composer dump-autoload then showing like this. " Fatal error: Uncaught Error: Class 'Cake\Http\Server' not found in D:\xampp\htdocs\my_app_name\webroot\index.php:33 Stack trace: #0 {main} thrown in D:\xampp\htdocs\my_app_name\webroot\index.php on line 33" –  Trishna Jul 03 '17 at 09:18
  • @Sehdev now i tried a composer dump-autoload then showing like this. " Fatal error: Uncaught Error: Class 'Cake\Http\Server' not found in D:\xampp\htdocs\my_app_name\webroot\index.php:33 Stack trace: #0 {main} thrown in D:\xampp\htdocs\my_app_name\webroot\index.php on line 33" –  Trishna Jul 03 '17 at 09:18
  • @Trishna Comments in Stack Overflow are public, I can read your follow-ups to other users. Whatever, you should provide the relevant details in the question itself. – Álvaro González Jul 03 '17 at 09:22
  • @ÁlvaroGonzález i tried the steps from official site of cakephp.and they shown download using composer. what should i do for fix the issue? –  Trishna Jul 03 '17 at 09:35
  • @Trishna I don't know, if I new I would have posted an answer. Instructions work for me. – Álvaro González Jul 03 '17 at 09:48
  • Just seen your edit... Are you installing from MINGW64 but running from Windows? Because regular Windows apps know nothing about `/d/xampp`. – Álvaro González Jul 03 '17 at 09:50
  • @ÁlvaroGonzález Yeah i am using windows. –  Trishna Jul 03 '17 at 09:52
  • @ÁlvaroGonzález now i tried all these into command window .but showing the same. any way thanks for your reply. :) –  Trishna Jul 03 '17 at 09:58
  • Your error messages appear to imply you are missing the required ext-intl PHP extension. Make sure you've got the [minimum requirements](https://book.cakephp.org/3.0/en/installation.html#requirements) set up before trying to install Cake! – drmonkeyninja Jul 03 '17 at 10:19
  • 1
    @drmonkeyninja You are right ...now fixed..Php.ini file edited..Thank you so much –  Trishna Jul 03 '17 at 11:09
  • @ÁlvaroGonzález Composers [**default vendor directory**](https://getcomposer.org/doc/06-config.md#vendor-dir) actually is `vendor`, with a lowercase `v` ;) – ndm Jul 03 '17 at 11:41
  • @ndm Dammit, you're right... What the hell was I confusing it with? – Álvaro González Jul 03 '17 at 11:42
  • 1
    @ÁlvaroGonzález Maybe with CakePHP 2.x, it uses these uppercase directory names by convention, and ships with [**a composer config**](https://github.com/cakephp/cakephp/blob/2.9.7/app/composer.json) that configures the vendor directory as `Vendor`. – ndm Jul 03 '17 at 11:47
  • @ndm Ah, that was it for sure. My latest project is some CakePHP/2 I installed with Composer. I'm terribly sorry for confusing everyone. – Álvaro González Jul 03 '17 at 11:53

1 Answers1

0

Run following command first (you might need to prepend this with sudo if composer was installed globally)

composer self-update 

then again

composer create-project --prefer-dist cakephp/app my_app_name
Sehdev
  • 5,486
  • 3
  • 11
  • 34
  • Hi, i tried the below code. but showing the below error Warning: require(D:\xampp\htdocs\mylogin/vendor/autoload.php): failed to open stream: No such file or directory in D:\xampp\htdocs\mylogin\webroot\index.php on line 27 Fatal error: require(): Failed opening required 'D:\xampp\htdocs\mylogin/vendor/autoload.php' (include_path='D:\xampp\php\PEAR') in D:\xampp\htdocs\mylogin\webroot\index.php on line 27 –  Trishna Jul 03 '17 at 09:26