How to get Firefox to work with PHP development

Asked by andrew prudente

Well, I hope I can explain this without presenting a complicated mental excercise. I was having difficulty getting LAMP to install properly so I could begin using it. After several days of this and that I finally, I dusted off an old (slow) laptop I had. I Nuked Windows and installed Ubuntu 10-10 32 bit on it. Then I installed LAMP on it using a script from

http://www.howtoforge.com/ubuntu_lamp_for_newbies.

On the old computer it worked perfectly. It showed how to included the libraries for Mysql and PHP which is key to making it work while some other scripts didn't address it.

Ok, so on the new computer which is dual core 64 bit HP laptop, I have it working as far as I can load a xxx.php file and it will execute correctly and access mysql using php calls. The problem I now have is as follows:

I have a parent page (html) when a user clicks on a send button it is supposed to bring up the xxx.php file.
I try to load my html page through the URL address box and a popup shows that says:

"You have chosen to open and html file -- What should firefox do with this file" and the drop down box offers Load into Firefox or save it. After selecting Load option, Mozilla changes the address from http://localhost/xxx.html to file:///tmp/xxx-1.html and loads the page. I can't find any setting in Mozilla to stop this behavior. Then of course my button link to the xxx.php file will not work from that new directory. If I copy xxx.php to the /tmp that Mozilla uses it then shows the popup again saying the same things execpt that Load into Firefox is not there. The only options are open with BlueFish (editor) or save it.

As I said, on the old laptop it works perfectly without any popups or changing the address. I'm thinking that this problem on the new computer is probably something to do with the 64 bit and 32 bit versions of Mozilla.

If anyone can offer any help for this by all means please post or mail me.

kind regards,
andrew

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu apache2 Edit question
Assignee:
No assignee Edit question
Solved by:
andrew prudente
Solved:
Last query:
Last reply:
Revision history for this message
David Álvarez (davidalro) said :
#1

Hello andrew,

It can be an Apache error, probably in the configuration file. It's possible that Apache doesn't presents it as text/html, so my suggestion is to make index.php and put:
<?php
header ("Content-type: text/html");
?>
In the top, before any content.
If it doesn't work, I suggest you:
1 - Look to sample Apache Configuration files and compare with yours, to see if there's any error.
2 - Try with any other web browser (Chromium?).

Bye

Revision history for this message
andrew prudente (aprudente-99) said :
#2

Hi

I added the php directive you gave me and I still have the same problem.

As far as apache conf files, where can I obtain a sample config file.

As far as Chrome, it doesn't have a version for AMD64 so I can't try it. It gives that error when I try to install it

So, this question is still open.

thanks and regards.
andrew

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#3

Please read the already answered questions here: https://answers.launchpad.net/ubuntu/+source/apache2

Revision history for this message
andrew prudente (aprudente-99) said :
#4

Hi

I have gone to the link you gave me and looked at a lot of questions and solutions however none of them describe the problem I am having. If you would like me to look at a particular entry in the list,let me know.

Just to summarize the problem, when I enter http://localhost/xxx.html, Firefox changes the address to file:///tmp/xxx-2.html and saves it there.

That is not going to work for Web Page development and I need help to resolve this issue.

thanks and kind regards,
andrew

Revision history for this message
andrew prudente (aprudente-99) said :
#5

Ok, after searching this web site and that I finally found an answer on YouTube. An explanation there used the Synaptic Package Manager to install the LAMP components separately. The Package Manager found certain packages either missing or not updated on my system. It is also smart enough to remove packages that probably would interfere with the installation of your present selection. The apt-get install script installs without errors but does not give you a totally working environment. Sure, you get "It Works" for Apache but that does not mean that mysql calls using php will work. The scripts seem to leave out the links to the libraries like mysql.so, and mcrypt.so. The test used to determine if everything is working is hopelessly inadequate.

To make matters worse, php5 comes in various flavors of 5.0.x to 5.3.x. They install conf files in different places and each one does something different. The docs you guys have are not keeping up with it. You can find the version (of any program) installed on your system using "apt-cache policy php5". Version 5.3.x has compiled-in mysql calls but the libraries still have to be installed. Using the Package Manager you can search for the names of them (mysql.so etc) and install the package which takes care of the library issue. v5.3.x also installs php.ini in /etc/php5/cgi/ where all the docs say that it is in /etc/php5/apache2/

When you run the script using apt-get ... and then something doesn't work, you are left high and dry as to what to do. The short of it is "use the Synaptic Package Manager" and work through whatever does not play by using it to search for certain packages. It will tell you what it is going to un-install as well as install and you can decide to continue if you want. Actually this excercise was good because I learned a lot about Linux in the process of finding these problems and making everything work.

kind regards,
andrew