xampp behaviour with .php files on Linux Manjaro

Problems with the Linux version of XAMPP, questions, comments, and anything related.

xampp behaviour with .php files on Linux Manjaro

Postby AlinP » 17. August 2020 13:36

Hi guys,

Newbie here. I just installed xampp 7.4.8 on my Manjaro Linux kernel version 5.4.52-1.
When I try and start xampp it seems to be working. Please see terminal output below:

$ sudo /opt/lampp/lampp start

Starting XAMPP for Linux 7.4.8-0...
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.

Also, when i type localhost in my Chromium browser I also seem to be ok and I can navigate to myphpadmin.

The problem occurs when I try to run a .php file. I am a complete beginner at web development and I created a file called index.php and aiming to print some text on the screen. Well, instead of executing the file and displaying the text on the screen my browser downloads a copy of the file in my Downloads folder.

Terminal output:
$ chromium index.php
Opening in existing browser session.

Screen printout below:
Image
AlinP
 
Posts: 1
Joined: 17. August 2020 12:56
XAMPP version: 7.4.8
Operating System: Manjaro Linux x86_64

Re: xampp behaviour with .php files on Linux Manjaro

Postby Altrea » 17. August 2020 18:29

AlinP wrote:Terminal output:
$ chromium index.php
Opening in existing browser session.


You cannot open plain .php files in your browser (unlike .html files which can successfully be opened directly in your browser).
PHP is a serverside programming language, so it needs to get processed by an php interpreter on your server.
You need to request a .php file by url (e.g. http://localhost/file.php , path is dependend on the save path inside your htdocs)
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11941
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 33 guests