php server not found

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

php server not found

Postby Wim Tewinkel » 18. April 2022 03:03

Hi, I have a macOS Monterey and installed XAMMP. When I try to run PHP server in VS Code I get a message PHP not found. When I ask to open page in Live Server I get a /listing directory.
Thank you.
Wim Tewinkel
 
Posts: 5
Joined: 18. April 2022 02:48
XAMPP version: 8.1.20
Operating System: macOS Monterey

Re: php server not found

Postby Nobbie » 18. April 2022 10:51

What is PHP server?
What is VS Code?
What is Live Server?
What is meant by "ask to open"?

Sorry, i dont get any idea of what you are doing there? Especially as VS usually means Visual Studio, a Microsoft Windows development environment, but we are here in MacOs forum.
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: php server not found

Postby Wim Tewinkel » 18. April 2022 18:02

Hi Nobbie, In reply to your questions the following. I am new at this and do not have a very good understanding how all the pieces fit together. PHP is a general-purpose scripting language for web development. Yes, VS (Visual Studio) code is made by Microsoft (it is a source-code editor) made for Windows, Linus and macOS. Live Server allows you to see the changes you make in a website on a browser window as you make them, so you can see if what if you did is correct. I mean with "ask to open" - if I click on the Command Palette line in VS Code, I get a "/listing directory" window instead of the Live Server display of the web site I am trying to work on. VS Code Live Server works with HTML pages. It is my understanding that PHP is built into XAMPP and it would automatically access the PHP program. Somewhere my computer does not make the connection and I do not know how to fix it.
My situation is, that I have a half developed website built by somebody else and I am trying to finish it, mostly by pasting and copying and making additons. In order to know that I am doing the right thing I need to be able to see it in Live Server as a go along.
Wim Tewinkel
 
Posts: 5
Joined: 18. April 2022 02:48
XAMPP version: 8.1.20
Operating System: macOS Monterey

Re: php server not found

Postby Nobbie » 18. April 2022 19:49

I know PHP very well, but i have (still) no idea, what you mean by "PHP server". I have never heard about a PHP server.

Same problem for "Live server", never heard that before and unfortunately you still do not explain what it is. Is it a tool (a software), and if yes, where did you download it, how did you install it?
Same problem for VS Code, where did you download it, how did you install it? Last not least - what is VS Code Live Server. You still do not explain at all where you downloaded it, how you installied it, what it is supposed to do.

I know very well Xampp, but not VS Code etc. - as long as you cannot explain more precisely, what you are doing, nobody can help you.
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: php server not found

Postby Nobbie » 18. April 2022 20:01

Ok, i googled a lot about VS Code etc.

To keep it short - forget about VS Code and Live Server. You dont need it if you are running Xampp and it does not work together well. Xampp already is a powerfull server and there is no need for any other server.

Simply put your files to htdcos folder and open http://localhost/myfile.php in a browser, that activates Xampps Apache (and PHP) and you can see the output of myfile.php
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: php server not found

Postby Wim Tewinkel » 19. April 2022 02:07

Hi Nobbie, In the first place thank you very much for your support and the help you are providing. I really appreciate it. At first I could not figure out why you didn't know about the PHP server, etc. I had just assumed that those terms were in general use, but I guess they are very specific to Visual Code. My mistake. When I started on this journey I made some changes in another web site I have and that one was written in HTML. I was able to make the changes using Visual Code and assumed that I could just continue from there. I will keep on learning. I was able to open the website as per your advice. I have for now two questions: 1) When I click on the php files in XAMPP, it opens the files in Visual Code. How can I change that without uninstalling VS Code (which I would like to continue to use for the other web site, since I know now more or less how it works). 2) When I start working on the code in XAMPP, will it show the changes automatically and immediately on the web site (similar to the VS Code Live Server process)? Once again thank you.
Wim Tewinkel
 
Posts: 5
Joined: 18. April 2022 02:48
XAMPP version: 8.1.20
Operating System: macOS Monterey

Re: php server not found

Postby Altrea » 19. April 2022 08:55

Hi,

You can keep VS Code to edit your PHP files.
But the functionality to run PHP files is nearly independend to XAMPP itself. VS Code does have a setting to set the PHP executable path. This can also be the PHP interpreter shipped with XAMPP. But you don't need all the other things XAMPP comes with.
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: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: php server not found

Postby Nobbie » 19. April 2022 10:46

1) You say "click on php files in Xampp", but this is not the correct description. You are clicking in a file explorer (i dont know much about MacOs, is it the Finder?), not in Xampp. Xampp does not deliver any explorer, neither any editor.

If you dont want to edit php files with VS Code editor, ask in a MacOs forum, how to assign any other editor to php files. That is a plain MacOs issue, it has nothing to do with Xampp.

2) Yes, Xampp (i.e. Apache) immediately shows all changes. BUT: keep in mind, that your browser may cache requests, if your browser does not show the changes, clear the browser cache. This actually happens quite often.
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: php server not found

Postby Wim Tewinkel » 20. April 2022 23:48

Hi Nobbie, Re - click on PHP files in XAMPP. When I open up XAMPP, activate the Services and Localhost and then end up on the Explore tab under volumes, tap on it, I get a list of files. If I left click on a php file it will open in VS Code, right click will give me application choices. I can open a file in TextEdit (=Notepad on Windows), but the XAMPP icon is greyed out. I can open MAMP from there, but in the next step the php files are greyed out. Also using http://localhost/myfile.php does not work for me. I thought it did at first but I must have followed a different path to open the web site.
Wim Tewinkel
 
Posts: 5
Joined: 18. April 2022 02:48
XAMPP version: 8.1.20
Operating System: macOS Monterey

Re: php server not found

Postby Wim Tewinkel » 21. April 2022 21:01

Altrea wrote:Hi,

You can keep VS Code to edit your PHP files.
But the functionality to run PHP files is nearly independend to XAMPP itself. VS Code does have a setting to set the PHP executable path. This can also be the PHP interpreter shipped with XAMPP. But you don't need all the other things XAMPP comes with.


Hi Altrea, Thank you for responding. Below is what I have in settings.json, but I do not know what is wrong and what to do do next.
hp{
"workbench.startupEditor": "none",
"workbench.colorTheme": "Visual Studio Dark",
"editor.formatOnSave": true,
"files.autoSave": "afterDelay",
"workbench.editor.enablePreview": false,
"liveServer.settings.donotVerifyTags": true,
"phpserver.ip": "localhost80",
"emmet.excludeLanguages": [
"markdown",
"php"
],
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"settingsSync.ignoredSettings": [
"-php.validate.executablePath"
],
"phpserver.browser": "firefox",
"phpserver.phpConfigPath": "http://localhost:8080/src/index.php",
"phpserver.phpPath": "http://localhost:8080/src/index.php",
"php.suggest.basic": false
}
{"php.validate.executablePath": "C:\\xampp\\php\\php.exe",
"php.executablePath": "C:\\xampp\\php\\php.exe"
}
Wim Tewinkel
 
Posts: 5
Joined: 18. April 2022 02:48
XAMPP version: 8.1.20
Operating System: macOS Monterey

Re: php server not found

Postby Altrea » 23. April 2022 20:33

Wim Tewinkel wrote:{"php.validate.executablePath": "C:\\xampp\\php\\php.exe",
"php.executablePath": "C:\\xampp\\php\\php.exe"
}

These are windows paths, but you are using Mac OS.
This is definitely wrong.
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: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 41 guests