PHP in root directory?

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

PHP in root directory?

Postby xampp_wanna_use » 02. May 2021 21:24

On a new Mac mini running IOS 11.3. I used xampp-osx-8.0.3-0-installer.

The default installation comes up fine. PHPAdmin works.

When I try to run a PHP file outside of the dashboard folder the .php file won't run. I have a mcsga folder in the htdocs folder and phpinfo.php won't run.

What am I doing wrong?
xampp_wanna_use
 
Posts: 6
Joined: 02. May 2021 21:05
XAMPP version: xampp-osx-8.0.3-0-vm
Operating System: 11.3

Re: PHP in root directory?

Postby Altrea » 02. May 2021 23:05

We don't know.
How do you try to access this files and what happens exactly?
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: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: PHP in root directory?

Postby xampp_wanna_use » 03. May 2021 00:21

If I go here: http://richstrinismini.lan/dashboard/phpinfo.php it works as expected.

when I go here: richstrinismini.lan/mcsga/phpinfo.php it sends me to google to search for that.

The files are identical: <?php phpinfo(); ?>

Oddly when I create a php file in dashboard and try to run it I get the same behavior where it's sending me to google.

This is content of that file:

<?php
$servername = "localhost";
$username = "test_user";
$password = "blah";

// Create connection
$conn = new mysqli($servername, $username, $password);

// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>
xampp_wanna_use
 
Posts: 6
Joined: 02. May 2021 21:05
XAMPP version: xampp-osx-8.0.3-0-vm
Operating System: 11.3

Re: PHP in root directory?

Postby Xunilpenguin » 03. May 2021 14:39

What do the permissions look like for both directories?

ls -la richstrinismini.lan/mcsga
ls -la richstrinismini.lan/dashboard
Xunilpenguin
 
Posts: 5
Joined: 28. April 2021 15:39
XAMPP version: 8.03
Operating System: Mac OS Big Sur

Re: PHP in root directory?

Postby xampp_wanna_use » 03. May 2021 16:08

I deleted the install and reinstalled XAMPP. I used terminal to create the directory and vs-code to create my files and now I'm able to run the files without issue. I'm not sure what I did different other than create the files with vs-code instead of drag and drop.

Thank you for your help.
xampp_wanna_use
 
Posts: 6
Joined: 02. May 2021 21:05
XAMPP version: xampp-osx-8.0.3-0-vm
Operating System: 11.3


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 21 guests