Skip to content

.htaccess not added in /public after installing this with help of composer #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pouyana opened this issue Dec 21, 2017 · 26 comments
Closed

Comments

@pouyana
Copy link

pouyana commented Dec 21, 2017

Is this pack working? According to symfony/demo#711 (comment) it should add .htaccess to the public folder.
But for me it did not do anything at all.

@BatsaxIV
Copy link

Hi @pouyana,

I've just tried it and it works, the .htaccess file is added in the public directory (see https://github.com/symfony/recipes-contrib/blob/master/symfony/apache-pack/1.0/manifest.json).

Could you provide more informations if this is still an issue for you?

@dtdpro
Copy link

dtdpro commented Dec 29, 2017

Using a clone of the symfony/demo app with the package manually added into composer.json, I have this issue.

On composer install (heroku deployment and local deployment) the .htaccess file is not added.

However when you run composer update (both locations) it is added.

@BatsaxIV
Copy link

Hi @dtdpro,

You probably have a composer.lock file that composer uses to install all the packages (see here) and that's why it doesn't read the composer.json file to add this package but when you do a composer update it works.

@karousn
Copy link

karousn commented Jan 12, 2018

i have the same problem after installing this recipes

@1151879477
Copy link

Is it a Windows issue? Why is it not directly contained in the installation package?

@1151879477
Copy link

The vendor\symfony\ apach-pack directory has only one composer. Json?No other files?

@karousn
Copy link

karousn commented Jan 15, 2018

@meiyoufengzhengdexian : it calling this repo

@gsylvestre
Copy link

Same issue here, after a fresh install with symfony/skeleton, on Windows.
.htaccess file is not created in public/ directory.
No error shown when installing apache-pack with composer req apache-pack

@ehymel
Copy link

ehymel commented Jan 17, 2018

For another data point, not working for me either (symfony 4), even after 'composer update'.

@karousn
Copy link

karousn commented Jan 17, 2018

i thought may be it be a good feature to have the possibility to execute the "flex script" another time since it failed to do what we want without make change if there file in the path.

@Invis1ble
Copy link

composer update also does not write any .htaccess file in public dir

@Gerben321
Copy link

Same on Windows

@kamilmaliszewski
Copy link

The same for me. I have SF4 & MacOS. File .htaccess is not created after composer install or update. I have installed SF from 'symfony/website-skeleton'

@fabpot
Copy link
Member

fabpot commented Feb 5, 2018

Anyone willing to debug the issue and propose a patch?

@gsylvestre
Copy link

Issue seems to be fixed for me with symfony/flex@b72fcd4

No problems after updating symfony/flex to >= 1.0.62

This is my understanding of the issue: the Console\Input\ArgvInput was set to non-interactive, leading the confirmation question (whether to execute the contrib recipe or not) to be skipped, thus using default value of 'n'.

@fabpot
Copy link
Member

fabpot commented Feb 5, 2018

@gsylvestre Thanks for the investigation. Upgrading Flex from time to time is a good idea :) Closing as this is now fixed.

@fabpot fabpot closed this as completed Feb 5, 2018
@haroldmodesto
Copy link

Not working for me. I have symfony/flex 1.0.71

@rwslinkman
Copy link

I'm also not seeing a .htaccess file being put in the public dir.
Using symfony/flex v1.0.78.

@rwslinkman
Copy link

I was able to resolve the issue in my case.
When inspecting my composer.json file, I saw that the symfony/apache-pack dependency was in the require section.

I removed that line and ran composer update and composer removed the package.
Then I executed composer require apache-pack --dev and chose the a options when asked.
Afterwards I looked at my git status and saw the .htaccess file in the public directory.
Refreshing the web page showed the debug toolbar at the bottom of the page.

Hope this helps anyone.

@tonybob-tl
Copy link

A few things. Make sure when you list the files under the folder, you request the hidden files as well (e.g., ls -a). It could be there, you are just not seeing it... Also, if you are getting errors during the downloads, make sure you have enough memory, especially if you are doing this on a remote server via SSH or similar. Also, errors may occur if your environment isn't set correctly, (e.g., export APP_ENV=prod if you are building a production environment - check by echo $APP_ENV).

@StanleySathler
Copy link

I faced the same issue.

What I did was slightly different from what @rwslinkman suggested. Since I was deploying my app into Heroku, I couldn't have symfony/apache-pack as a dev dependency.

First, I removed my already existent installation. I just removed the symfony/apache-pack dependency from my composer.json file (manually) and then I ran $ compose update to update my composer.lock file. After that, my composer.lock file didn't have apache-pack anymore.

So, I just ran the installation command again: $ compose require symfony/apache-pack. This time, a few options were given confirming if I wanted to execute the recipe. I just chose option [a] Yes for all packages, only for the current installation session.

This time, both compose.json and compose.lock had the symfony/apache-pack dependency, but it had also the .htaccess file in the /public directory.

@webdevilopers
Copy link

I had a similar problem when executing the composer update via PHPStorm console. The interaction menu @StanleySathler mentions did not appear. I then used my Ubuntu terminal which worked fine.

@vigorousss
Copy link

how resolve this problem?

@StanleySathler
Copy link

@vigorousss did you try all the different steps explained above?

Specially these ones:
#1 (comment)
#1 (comment)

@ghost
Copy link

ghost commented Jun 27, 2019

I fixed this by clearing cache.

composer remove symfony/apache-pack
composer clearcache
composer require symfony/apache-pack

@makhloufi-lounis
Copy link

J'ai pu résoudre le problème dans mon cas.
Lors de l'inspection de mon composer.jsondossier, j'ai vu que la symfony/apache-packdépendance était dans la requiresection.

J'ai supprimé cette ligne et exécuté composer updateet le compositeur a supprimé le paquet.
Ensuite, j'ai exécuté composer require apache-pack --devet j'ai choisi les aoptions quand on leur a demandé.
Ensuite, j'ai regardé mon statut git et vu le .htaccessfichier dans le publicrépertoire.
L'actualisation de la page Web a montré la barre d'outils de débogage en bas de la page.

J'espère que cela aide n'importe qui.

Thanks it worked for me too, just a remark no need for --dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests