Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

As I'm teaching myself PHP and MySQL during break, I'm experimenting coding in a Ubuntu virtual machine where Apache, MySQL and PHP have been installed and configured to a shared folder.

I'm not a big fan of Kompozer because the source code layout is a PIA, so I've started checking out gPHPEdit. However, since using it, I've come across two issues:

  1. when I edit the .html and .php files, sometimes the file extension will change to .html~ and .php~, becoming invisible to the browser. The only solution is to switch to Windows, right click and rename the file extension.
  2. In Ubuntu Firefox, when I click on my prpject's Submit button for in a practice form, a dialog box pops up asking what Firefox should do with the .php file, rather than simply displaying it in the browser. When I do this in Windows Chrome & Firefox, it goes right to the response page.

I'm not sure if this behavior is limited to gPHPEdit/Kompozer, but I've never noticed this happening in Dreamweaver. Any solutions?

EDIT 1 The behavior in Point 1 occurs both when Dreamweaver is open in Windows accessing the same files and when it is not. I changed the extension filename of welcome.php, added a comment in gPHPEdit, and the file changed to welcome.php~ upon saving.

EDIT 2 Using Geany in place of Kompozer/gPHPEdit has solved this problem.
Point 2 behavior is resolved after closing then restarting Firefox.

share|improve this question
    
There's no need to boot in to Windows, just press ctrl+H in the file manager to view hidden files. This doesn't solve your problem but it should cut out the pain of having to boot Windows. –  dv3500ea Dec 29 '10 at 22:36
    
I'm not booted in Windows, Ubuntu is in a VM, as I wrote in the first paragraph –  Jason Dec 29 '10 at 22:37
add comment

2 Answers 2

up vote 1 down vote accepted

For Point 1 - your editor is making a backup files. Backup file are normally pre-seeded with a ~ symbol. Like for example using gedit, kate or bluefish. They make a ~ file AND additionally add the dot sign in the front to make it invisible so it does not bother the programmer as a backup file. You can remove this behaviour form any editor in the preference/configuration/settings options where it mentions the way to SAVE/LOAD files. normally it will say something about "Make a backup with the ~ prefix"

For Point 2 - You can NOT open a php file using firefox because a PHP file is first processed by a server, normally a server that has apache+php services. Firefox first sends the info that it wants to see the php file, the php service processes the php information and then it sends it to apache which sends it to you and it firefox renders the page for you.

Does not matter if you are in windows/mac/linux in all cases the PC where you want to see (Or correctly PROCESS the php file) should have the services needed for it AND the php file in a directory read by the html service.

In the case on Ubuntu, you will need for example the apache + php services installed AND the php in the directory that http://localhost points to so it KNOWS it is serving the php file as a web service. That way apache and php take care to correctly process the php file and send it to the browser so it can render it.

Verify in your case that you have php/apache in the place where you are running the browser AND verify that the php file is in the web directory (normally in /var/www or /home/USER/www)

Start the browser with http://localhost and browse THROUGH there to the php file.

EDIT: Just read your edit. Make sure that the virtual Ubuntu has an IP that when you type it in the host it goes to the Virtual ubuntu. that way you have a Virtual PC where you can make the web and the host who is the client. For example:

HOST - 192.168.0.1 VIRTUAL - 192.168.0.10

WebSite: http://192.168.0.10

share|improve this answer
    
Looks like my Point 2 was something going on with the browser. After I restarted it, it returned to normal behavior on the localhost. However, this behavior has happened four times in the past hour, and can only be resolved by restarting. –  Jason Dec 29 '10 at 23:01
add comment

You should not use multiple questions in a single post. Point 2 is related to mime/type caching, you probably tried to access localhost PHP files before installing PHP. Clearing the browser cache is usually sufficient.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.