php not working on browser (localhost)

I just bought this pretty 14' M1 Pro On Monday, migrated my M1 Air..great. Added MySql 8, Added php8.1 through Mac Ports using Xcode. PHP works front the command line, but does not activate. Started Apache Server, It works. However, PHP will not see any file if running in development mode, no matter the directory, no matter if I add the file extension or not {php81 -S localhost:8080/index.php.} Nor will Apache recognize PHP as code, it just spits it out on the browser. I am stumped. I bought this machine (at least this is the excuse I used) So I can do all of my development projects on it. But I can't even get PHP to run in the browser. I've installed , updated this file and that, the only thing I know is there is no libphp.so module at all, and even if there was, it has a Certificate Problem , and this thing is still under warranty. Any help would be greatly appreciated.


MacBook Pro 14″, macOS 13.0

Posted on Nov 9, 2022 2:58 PM

Reply

Similar questions

9 replies

Nov 9, 2022 3:25 PM in response to BobTheFisherman

maybe I didn't explain it correctly, my bad I'm kinda frustrated with it. I have installed PHP on my Apache server that comes with macOS. Until Monterey evidently this wasn't a problem, but Apple has decided to depreciate PHP, well that's what I use on my actual hosting platforms, and production web applications. My problem is i cannot get PHP to activate in the Apache2 server, so when it serves my pages on the local host, my php coded (pages) won't run. I am lost how to make this work, everything I looked up on stack-exchange, and everywhere else isn't new enough or does't help, and I couldn't find the php8.1 so module on GitHub either. Yes, PHP is server-side, but I can only get it working from the command line right now, and temperamental if that. I need the server to use it, so my pages can run.

Nov 9, 2022 5:03 PM in response to Anastasia_Franco

Anastasia_Franco wrote:

Well, then so am I. That's not very helpful, and PHP is excellent for web-site based services. Anyway. Thanks everyone, not too much help her, but I thought' I'd give it a try.

That's just the way it is, helpful or not. Use of PHP is going to lock you into an old-style of work that is getting more and more difficult every day. Look into AWS Lambda for such things instead.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

php not working on browser (localhost)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.