Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command composer require symfony/apache-pack doesn't create .htaccess file

When I execute the command:

composer require symfony/apache-pack

It doesn't create an .htaccess file as it is cited in the documentation here.

How can I fix this problem ?

like image 933
hafida Bo Avatar asked Jul 18 '26 23:07

hafida Bo


2 Answers

If apache-pack is installed in your project and you later remove the .htaccess file from the /public directory, running composer require apache-pack will not re-install the .htaccess file. You must first remove apache pack.

So, first run composer remove symfony/apache-pack

And then run composer require symfony/apache-pack

As explained here : https://github.com/symfony/recipes-contrib/issues/676#issuecomment-519959252

like image 83
MaxiGui Avatar answered Jul 22 '26 04:07

MaxiGui


The solution is :

1-removing symfony/apach-pack from required in compoer.json 2- run command

composer update

which delete apach-pack from project.

3-run again the command for installing apach-pack as cited in the documentation here:

composer require symfony/apache-pack

4- when asked this question :

Do you want to execute this recipe?

type :

Yes

5- That's it now the file .htaccess exists

like image 41
hafida Bo Avatar answered Jul 22 '26 03:07

hafida Bo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!