Learn to Code via Tutorials on Repl.it!

← Back to all posts
php.ini on replit webserver
h
BastelPichi

So ive seen alot of questions how to enable php modules on replit. Ive done some testing and now found a way. Im not shure that this works properly for all modules.

1) copy php.ini:
ususally the feault php.ini is located at /etc/php/7.2/cli/php.ini. So to copy it, run cp /etc/php/7.2/cli/php.ini ./. If that dont works, run php -i | grep 'php.ini' and replace it in the above command.

2) Do your modifications
Now you can do you modifications to the php.ini file.

3) Start webserver with custom php.ini
To start the webserver now, run php -S 0.0.0.0:8000 -t . -c php.ini. If you want to run this command on the start button, run echo 'run = "php -S 0.0.0.0:8000 -t . -c php.ini"' > .replit on shell. Now your modules should be enabled!

Hope this helped you!

If there errors, you may try to run install-pkg php-<module name>

Voters
DynamicSquid
Highwayman
BastelPichi