This forum is no longer active. Please post your questions to our new community site

Forums WordPress

Editing PHP files in Ubuntu?

Subscribe to Editing PHP files in Ubuntu? 8 post(s), 2 voice(s)

Avatar antonq 5 post(s)

Hi there
Being an old windows groupie I am stuck on how to easily edit files on the new WordPress 3.0 stack running Ubuntu in VMware.

I was able to get as far as logging in to a VM remote console and getting a UNIX command prompt in BitNami that is running my WordPress stack.

I am unable to properly use VIM to edit a file however.

Is there an easier way to get to the proper folder and edit the wp-config.php file when I need to?

There is no FTP running and no Graphical interface to make things easier.

What would be the simplest way to text edit files in a VM/Unix environment?

Avatar Beltrán Rueda Administrator 3,714 post(s)


You can install in the machine other editors: emacs, vim, nano, etc. with “sudo apt-get install PACKAGE”. Also if you want to edit the wordpress files from Windows you can use the WinSCP tool. You only have to enable SSH in the virtual machine (disabled by default for security reasons). You can find more info in the “how to enable sshd” at

Then you can see the file system from Windows using the WinSCP tool.

I hope it helps.

Avatar antonq 5 post(s)

Thankyou I am sure it will help a lot.

One other question I am hoping you can help with.

I have edited the Site and URL settings in WordPress and saved a VM snapshop of the machine which has been a real help.

It seems whenever I restart the Unix in VM I lose the Site and URL settings.
I don’t understand why the settings don’t stick after a restart.
They revert back to the initial settings of the original install.

I have to restore the snapshot to reconnect properly since I have configured my network to work with my dns name forwarded to a DDNS service.

Thanks for your quick response to my editing issues.

Avatar antonq 5 post(s)

To follow up on installing a new editor…
I get the error message

Reading package lists….Done
Building dependency tree
Reading state information…Done
E: Unable to locate package nano

Any reason why I cannot install any other editor?

Avatar antonq 5 post(s)

Regarding the WinSCP utility
Is there any difference between it and FileZilla?

I managed to connect to my Ubuntu server from FileZilla but now cannot see the file properly formatted in Notepad when I try to edit a Linux file.
Is there a windows editor I should use that will properly format a Linux file?
Is there any concern that a windows formatted text file will not be properly read in Linux?

Avatar Beltrán Rueda Administrator 3,714 post(s)


It is necessary to update the repository before installing any package:

sudo apt-get update

Then you can install any editor.

You can also use Filezilla but you have to configure the SFTP access. You can use Wordpad on Windows to edit files or another editor, it should be compatible with linux.

Avatar antonq 5 post(s)

Thankyou again. That works.

Do you have any thoughts on why my Site and URL changes are not sticking after a restart of Ubuntu?

And one final question.
I don’t know which directory to look for the wp-config.php file.
Where do I look?

I noticed that some directories require root authorization.
If I am using Filezilla or or WINSCP how does one run the SUDO command to authorize access.
Will I require Root authentication to edit the WP file?

Avatar Beltrán Rueda Administrator 3,714 post(s)


Wordpress requires to set the public URL or IP address in the database. We will include a tool (/op/bitnami/updateip) to update the database automatically when the machine is restarted. If you have configured the URL you can remove this tool to not update the URL automatically.

The wp-config.php file is in “/opt/bitnami/apps/wordpress/htdocs” folder. You can set the permissions to “bitnami:daemon” so you can edit from the bitnami account:

sudo chown -R bitnami:daemon /opt/bitnami/apps/wordpress/htdocs


Forums WordPress