Hi. I want to update the uploadmaxfilesize in php.ini document but apparently i don’t have permission to edit this file. Is there anyone know how to get access to be able to modify this number?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
System settings files, such as php.ini, typically require root level permissions to modify. Sometimes, settings files even require root to even read them, since they may contain login credentials for databases and such.
You’ll need to elevate to root, usually using the sudo command to execute your editor, and that will require you to enter your password the first time you do it within a configured session lifetime.
Or you could su to root, but typically, droplets don’t come configured with a root password, so password login to root won’t even work.
I take it you have created a new user on initial setup and granted admin privileges to the new user? somewhere in line with this guide
If you have try this…
Login with created user credentials:
ssh username@ip address`
Once logged in type this:
sudo bash
Enter your password, this should then show you in control as root user (root@yourdropletname:~#) Next enter this:
nano /etc/ssh/sshd_config
Search for a section where it says “PermitRootLogin” and if set to ‘no’ change to ‘yes’
Press ‘Cntl+X’ to exit then ‘Y’ then ‘ENTER’ to save.
Type:
reload ssh
Now root (<—user) login through SFTP to change you php.ini file inside etc/php5/apache2/ to suit. Once this has been edited and saved go back to the nano /etc/ssh/sshd_config step and change back ‘PermitRootLogin’ to ‘no’ and remember to reload ssh again.
Finally use this command:
sudo service apache2 restart
Hopefully that should do it! Worked for me : )
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.