xampp does not run php, browser asks what to do with file - php

I just installed xampp from www.apachefriends.org.
Per the instructions I ran
sudo ./xampp-linux-*-installer.run
Then xampp started and I saw the gui control panel. Everything great so far.
I verified it works by going to localhost in Firefox. I saw the welcome screen.
Then,I navigate to my test html. It is a contact which runs a php file when clicking submit.
Then firefox sends a message what to do with my php script, sendeail (save or select an application). sendeail is a no-brainer php script for email which I found on the internet years ago. It works when running from my server and has been for ages. Just now running locally with xampp started, Firefox doesn't know what to do with it.
What should Firefox do with this file?
Do I have to configure xampp somehow?
I couldn't test in Opera or Chrom(ium), the submit form doesn't appear for some reason on my local computer, but whose browsers work fine when accessing the page on the server.
I am running in Linux Ubuntu 16.4 LTS, Firefox 65.0.1 64-bit
--- edit ---
Specifically, the question is that the web browswer sees the .php file and tries to open it, what must I do for the web browser to be passed the code within the .php file, instead?

.apachefriends.org has no explanation of this. I found another page which explains, https://www.fayazmiraz.com/how-to-run-your-first-php-code/.
One has to put their php code into /etc/xampp/htdocs
That's so counter-intuitive!!! OMG why can't I keep my files in my development directory. Yeah, I can test this way, but I'll have to keep updating that directory whenever I have a program change! Thank you

Related

How do I configure vscode live server to process php files properly (it is work very well with .html files )?

I am trying to develop web pages with php calls using vscode and vscode live server. I have installed live server and it works fine with html/css/js. However if the code I'm developing refers to a .php file, I just get the text of the php file, it is not executed by the server. I did find live-server-web-extensions which installs into the chrome browser, presumably to do a reload when the php files are modified as well.
So what I need to know is: How do I configure the server to process php files? I do have php.exe on my system, and if I used the php browser, things work fine. But I'd like to use vscode and live server for development, and I'm missing the secret sauce. I'm am using the Chrome browser and Windows 10problem

Apache 2.4 Rasbery PI server requested url not found port 80

I am making a website using my raspberry pi with Apache 2.4, php5, and mysql. However, my website randomly stopped working. I went into phpMyadmin and created a database and it looks like after that it just flat out stopped working.
I believe the issue may be in the apache configuration since I can't even serve a simple php file.
PS. I am following a udemy course and used his exact code to test if it was my replicated code causing the problem. This didn't help. Also by putting a file called test.php and going [rasberypi IP addr]/test.php gave me the same issue not found.

Tiny PHP Script runs fine on dev server, fails on hosted server

Im pretty new to php, Ive got a linux server running php 5.5.9 , and all I want it to do is take whatever is sent to it in an http post, and dump it to a file.
Currently the code I have is this
<?php
file_put_contents("outputfile.txt", file_get_contents('php://input'));
It works 100%, does exactly what I want when its on my own server.
When I upload it to my web server (HostGator) it gets a 500 error. The web server is running php 5.4, Im not sure if thats the issue.
Basically what Im trying to learn is why doesnt this work, and how do I fix it, its a pretty simple script.
John and Louis pointed me to the right answer, it was entirely the permissions on the folder the files were in. The folder was 777 for some reason, and switching it to 755 like the files were fixed it.
I had no idea that could even cause a 500 error

phpmyadmin display source code on Chrome

On VPS I have phpmyadmin on Apache2.
On every computer and IE n my computer works fine, but on Chrome on my computer it shows the source code of phpmyadmin index. Why? Is there any settings or what?
This is just happening only on this page on Chrome on my PC.
The error "shows the source code of phpmyadmin index" you are describing implies that your apache cannot run the php file. This can be happen for 3 reasons
You are pointing your web browser to the folder something/ and apache does not know that it has to search for the index.php file. Fix your apache configuration or point directly your web browser to this file something/index.php
Your apache is not configured to use the php interpeter
You don't have php installed to your machine
Think that found solution, but don't know what cause it.
I used CCleaner to clean all Chrome browser data
- the simplest solution xD

Mediawiki engine only works on Lan, works intermittently externally

I have recently installed a LAMP server running ubuntu server 11.04. I am trying to run a private mediawiki engine online, version 1.17.0. For some odd reason it works perfectly on the LAN only, when I use an external network, it would continue load forever and proceed to being timed out. Other folders I have seemed to be doing fine externally so I believe my network configuration should be ok. Sometimes when I do get lucky (like 10% of the time), it will load normally for a few pages and resume once again to hanging. If I stop the page load it would appear but the skin would be missing.
I used firebug and found that 2 processes with something like load.php/debug=false....style:skin=vector that is hanging while all the other files load fine. If I stopped all the extensions, killed both common.js and common.css, and prevent the use of javascript on the site, it would work fine (relatively speaking, it would load everything quickly). I think it is a javascript problem but I am not sure where to look for an error log for java.
When checking the firefox error console I also noted the same error location had a "message: expected '}'". However, when running in the LAN it has the same message but it still works fine. I tried looking through all possible resources but to no avail.
Finally found the solution to this problem: it was a networking issue afterall. I checked all the logs and could not find anything. But found that the problem was that the ubuntu was running under a dchp setting so I changed it into a static ip mode and now it works perfectly. Althought I don't understand why it would make a difference between broadcasting via LAN only vs. external, it works perfectly now. Thanks to anyone who tried

Categories