Page 1 of 1

Install in Macos 12 Monterey

Posted: 30 Oct 2021, 13:55
by christianch
I just switched to Macos 12 monterey in a new mac mini.
I installed php 8 via homebrew but I am having difficulty with httpd.conf to make php work in localhost and therefore Files app ....  :tired_face:
I read #PHP was deprecated in macOS 11 and removed from macOS 12 .....
Do you have any recommendations? thanks very much

Re: Install in Macos 12 Monterey

Posted: 31 Oct 2021, 00:21
by mjau-mjau
Sorry, I can't really say much about this since I didn't upgrade yet. Besides, I'm not too comfortable with installing and updating packages myself using brew/terminal, and often have to search around trying to get things to work. I found one article which would be the first one I would try myself:
https://tech-cookbook.com/2021/10/25/ho ... -monterey/

Does PHP work at all though? I would imagine it's something about PATH  ...

Re: Install in Macos 12 Monterey

Posted: 31 Oct 2021, 04:36
by christianch
Hi Karl,

Apache is ok 
Php 8 is ok 

Last login: Sun Oct 31 09:10:29 on ttys000
@mac-mini-de-christian ~ % php -v
PHP 8.0.12 (cli) (built: Oct 21 2021 06:07:28) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.12, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.12, Copyright (c), by Zend Technologies
@mac-mini-de-christian ~ % httpd -v
Server version: Apache/2.4.51 (Unix)
Server built:   Oct  7 2021 14:21:57
christiancharreau@mac-mini-de-christian ~ % 

I try to modify the httpd.conf like with this
https://websitebeaver.com/set-up-localh ... h-sslhttps 
 but without success .....

Re: Install in Macos 12 Monterey

Posted: 31 Oct 2021, 04:59
by mjau-mjau
If PHP and Apache is working, it's not quite clear to me what's not working.  What happens when you access your localhost in browser? And what happens when you try to access a PHP files from browser?

There is another solution called MAMP (for Mac):
https://www.mamp.info/en/mac/

Re: Install in Macos 12 Monterey

Posted: 31 Oct 2021, 10:53
by christianch
What happens when you access your localhost in browser?
It works!
With index.html
It don't work!
With this php file .... test-php.php
Code
<?php

[color=#000000]//s'il y a que le texte bonjour qui est affiché, alors php est activée [/color]

[color=#000000]// si vous lisez ces commentaires alors php ne fonctionne pas[/color]

[color=#000000]echo "bonjour";[/color]

?>
Yes I know MAMP, but I'm waiting because I saw on different forums than it's not stable with Macos 12 and it's not free 79 € .....  :grimacing:

Karl it is not a Files App pb , I have asked just the question if you had have meet the pb .... thanks for yours answers.
I continue to scan the web, the solution issue should coming soon ...  :wink:

Re: Install in Macos 12 Monterey

Posted: 31 Oct 2021, 11:44
by mjau-mjau
Yep I can see that your server (Apache) is not loading the PHP module, thus the PHP is rendering as text. Sorry I can't  help more ...

Re: Install in Macos 12 Monterey

Posted: 04 Nov 2021, 08:04
by christianch
Hi, just for correction, because I told a false information, it's possible to run MAMP free app without the version pro. 
So Files app run well on Macos Monterey. 
Since , I didn't always find how run php in localhost, whithout a tierce app, but Idoesn't despair.