lando / wordpress

The Official WordPress Lando Plugin
https://docs.lando.dev/wordpress/
GNU General Public License v3.0
13 stars 6 forks source link

Custom php.ini not loading #19

Closed Rufus13apostol closed 5 months ago

Rufus13apostol commented 2 years ago

Hi there,

Using: lando v3.6.5 docker: 20.10.8 os: win 10

Im trying to load the custom php.ini file but no luck so far. This is my yaml:

name: standalone
recipe: wordpress
config:
  php: '7.4'
  via: apache:2.4
  webroot: .
  database: mariadb
  xdebug: false
  config:
    php: config/php.ini  

I´ve tried many variations of that code, but none works, load php.ini in phpinfo is always blank...any thoughts?

vishalbasnet23 commented 1 year ago

Any update on this?

Rufus13apostol commented 1 year ago

Yes, for some reason, writting the php.ini like in lando docs it does not work, it just create a folder named php.ini, instead of a file. The workaround is to create the file manually and named it differently: “custom_php.ini” for example, and put the variables there. Most commom need of this are:

upload_max_filesize = 410M post_max_size = 410M

In order to check if it really works, just enter the container through “lando ssh” and launch the following command: php -i | grep 'upload_max_filesize' . It should return the values in the php.ini, if not try “lando rebuild -y”.

reynoldsalec commented 5 months ago

Would be good to verify if this is still an issue; close out if unable to replicate.

christopher-b commented 5 months ago

I just did a bit of testing, and setting a custom php.ini seems to work as expected: I was able to create ./config/php.ini, reference that file in my lando file and verify that the custom settings were applied.

You do have to create the file manually before letting lando build the project. If the file doesn't exist, lando will create ./config/php.ini as a directory (for some reason). That behaviour may be unexpected, but the workaround is to just create the file before building the project.

oskarmodig commented 5 months ago

Me as well, same result. I can add that it's the same for docker file share exclude, and specifically files ignored from excludes: https://github.com/lando/lando/issues/3441

reynoldsalec commented 5 months ago

Thanks for checking this out @christopher-b + @oskarmodig, in my mind we should try to stop Lando from creating those directories, although that might go deeper into how Lando uses Docker to share those files into the container, since I believe it's mounting them in there. To prevent that I guess Lando would need to check for the file's existence before attempting to mount...guessing @pirog might have better guidance here since we're getting into deeper territory.

Rufus13apostol commented 5 months ago

Manually creating the file seems to be the soltuion then, closing the ticket. Thank guys for checking up.