You have Git installed?
Trouble installing on Windows 10
I need a "holiday dev computer", so I'm installing Laravel on a Windows 10 laptop. In the past, I have always installed on Linux and it was a breeze. Windows is a major pain in the butt. Here is my issue:
-
composer create-project laravel/laravel mysite "5.6.*"The download kicks off and then quickly gives me a message:
Composer could not find the config file: C:\xampp\htdocs
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
So I look into the project folder and there is all the Laravel directories including the composer.json file. There is no vendor directory and no framework. So why can't it find the json file?
I have another problem, but one post one problem. So, any ideas what is going on? Gosh I hate Windows.
Many Thanks !
No
Install Git, clear composer cache, etc. Try again.
I haven't seen @jimmck around lately.
No, I haven't see Jim either, mind you I don't come on much myself.
because I am a solo developer, I have not used Git. So Dumb question - what do you want me to do with Git?
It's just required to use composer I had to install it myself this has been over the last year prior to that it seems just composer worked.
I didn't have to do anything except install it then composer worked fine. I know weird huh.
Ok - cheers I'll give it a go tomorrow AM and let you know - many thanks !
the better way is , install a ubuntu on your computer , that was much easier.....
for real , don't use xampp , install apache and php manually , there are tons of tutorials on the internet . and of course , composer has a internet connection problem depends on where your country is ....
and , what is your version of win10 , strongly recommend win 10 pro , not family or student version .
I also develop on a windows 10 machine and use WSL pretty much for everything. I found a nice way to setup composer, git, valet (a fork made for linux) and all that good stuff running on WSL. The initial setup might be a bit of a pain (maybe it will be easier for you since you are already familiar with the process of installing on linux) but I have to say that I absolutely enjoy it.
If you want to give it a try, this is the tutorial I followed to have everything setup: https://patriqueouimet.ca/post/setting-up-windows-subsystem-for-linux-for-laravel-development-lemp
The only things I changed from the tutorial was the installation of PHP. I installed the latest 7.2 version from this PPA: https://launchpad.net/~ondrej/+archive/ubuntu/php
Highly highly recommend for all the Windows users to grab - https://laragon.org/download/ In 5 mins you will have a fully operational laravel instance with all you need + server and database. After you install it just simply right click on the new trey icon in the corner and go to 'quick create' then just click on Laravel, give it a name and you are all done :)
Thank you all for your recommendations. I have a second problem, which I did not mention in my original post. On my various attempts to install Laravel, I have hit a second warning message:
[ErrorException] file_get_contents(C:\xampp\htdocs): failed to open stream: Permission denied
Ok - this is a permissions issue obviously. So I have gone into Windows security and opened up everything for every user under the htdocs folder. And STILL I get this error.
@m7vm7v Yes, I tried Laragon, and I get the same error. Although, yet Laragon is a fast install.
@MaverickChan I have deleted Xampp. Yes, I am seriously considering just installing manually.
@jlrdw installing Git did not fist things for me. Thanks though.
Make sure all of the required extensions are enabled.
@vincej , remember , laravel 5.6 requires php 7.2 , check your php -v.
and here are some hints of install wamp manually :
- choose x86 version of apache 2.4.
2.choose x86 version of php 7.2.
3.install composer.
4.install node.js , you can choose LTS version of the newest one , i prefer LTS , it is stable.
5.install cmder , it is a better command line tool , you can use some unix command.
6.be sure to config apache and php right.
7.php 7.2 has changed a lot from 7.1 , some of the extensions are removed , please read the change.log.
8.it is always pain using windows as a dev machine , but win does not have permission troubles.
@jlrdw Do you mean extensions within Apache?? Any idea where to find a list of "required extensions".
@MaverickChan I had indeed installed php 7.2. No problem there. Why do I need node.js?
Laravel installation requirements. https://laravel.com/docs/5.6#server-requirements
I think it's just easier to install homestead. It gives you an Ubuntu vm, php 5.6 - 7.2 along with all extensions needed by laravel, mysql/postgres, nginx (or apache), and sets everything up. To add a new project to it, you just add 2 additional lines to the yaml file and reprovision it. Oh, and it doesn't mess you os up bc you're not installing anything "in" your os. So windows is left pure. I do like to install composer/git/npm globally in windows though.
@vincej , because if you want to change some css or Vue.js component , you will need npm to compile them.
@Cronix Good suggestion. However, my reluctance to install homestead stems from the fact that I only have a 256GB SSD on this laptop and it is already 3/4 full. I have it in my head that Homestead+VM+Ubuntu will really be huge. BTW - nice to see the real Cronix, not the smeared image of Codeigniter days! :o)
@MaverickChan I don't use vue yet. I write raw javascript and css. So, I have no experience of npm. Maybe I should look at it.
i'm not suggest the VM way if your host computer NOT enough ram
i don't know other type database, if MySQL, in the my.ini you need set the innodb_buffer_pool_size=, unless you don't care many I/O on the harddisk
actually manually install MySQL + Apache + PHP not really hard
MySQL - download a installer, almost can use default settings, ofc you need type the root password
Apache and PHP - download the right version, 32-bit/64-bit VC14/VC15
config Apache --
enable mod_rewrite
change some path / port number
add to the end of the conf\httpd.conf
LoadModule php7_module "path_to_the/php/php7apache2_4.dll"
AddType application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "path_to_the/php"
<VirtualHost *:80>
DocumentRoot "path_to_project/public"
ServerName localhost.test
<Directory "path_to_project/public">
Options FollowSymLinks
AllowOverride All
Require local
</Directory>
</VirtualHost>
edit C:\Windows\System32\drivers\etc\hosts
127.0.0.1 localhost localhost.test
config PHP -- most important part is
max_execution_time =
max_input_time =
error_log =
upload_max_filesize =
extension_dir =
extension =
Edit System Environment Variables In Windows 10
I don't know if you still have environment issues, but I too have a small-SSD Win10 laptop as an alternate to PC+Homestead and I use Laragon on it (https://laragon.org/). It makes many of the little setup details for you, and customizable if needed (PHP/mySQL versions, optional php modules, hosts files management, etc.)
Update: oops, just noticed the other Laragon recommendation...
Please or to participate in this conversation.