Created
December 18, 2022 18:50
-
-
Save 4sskick/54010d945f46267378a62a7ccc075619 to your computer and use it in GitHub Desktop.
docker image from project https://github.com/4sskick/infra
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I faced a problem when doing some development on Code Igniter project. I have to setup .htaccess to remove index.php from URL. Also face a weird problem when I catch the POST value from form view I created. They aren't delive value of POST data | |
short lonk story, after I evaluating the whole project's config of framework. Turns out that the culprit is the .htaccess file. | |
So I need to check the module is already enabled or not on apache. Here the repo project I mean https://github.com/4sskick/infra | |
Disclaimer: | |
=========== | |
this only a temporer solution, I believe when I remove the base image of container project, the setup would be back to default. | |
So you have to re-enable the steps I write here. DYOR ! | |
- make sure you already run the container by docker-compose up -d | |
- list the container by type, 'docker container ls', look for name with suffix _php. In case for the repo project would be 'ck_php' | |
- time to run service only to that container by type 'docker exec -it <name_container: ex ck_php> bash'. To access shell on it | |
- because mod_rewrite is an apache module, so you have to make sure it already enabled or not by type, 'apachectl -M' | |
- see for 'rewrite_module (shared)', if see none then enable it by type, 'a2enmod rewrite' | |
- container gonna ask to restart the service by type, 'service apache2 restart'. | |
- container terminated, don't worry just re-run the command 'docker-compose up -d' | |
- check again to make sure if module is already enable by accessing shell of container 'ck_php' & type 'apachectl -M' see for rewrite_module | |
- done |
oowh BTW!
for a simple check about module apache mod_rewrite enabled already or not, just echoing the 'echo phpinfo();'. Then look for mod_rewrite, if exist then enabled or else. GOOD LUCK!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I will update the config of apache PHP's Dockerfile soon, so won't have to enable manually