-2

I have installed php and python in my mac and made the changes required in httpd.conf file as well.

I have restarted the apache web server as well.

Here is my php webpage

enter image description here

Here is my python webpage

enter image description here

enter image description here

Please find my httpd.conf file here

If anyone can help me understand the issue , I'd appreciate it.

This is to be noted that plain html has no issue. PFBenter image description here

Here is my python version information

Python 3.11.4 (v3.11.4:d2340ef257, Jun 6 2023, 19:15:51) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin

Here is my php version information

PHP 8.2.4 (cli) (built: Mar 16 2023 16:10:27) (NTS) Copyright (c) The PHP Group Zend Engine v4.2.4, Copyright (c) Zend Technologies with Zend OPcache v8.2.4, Copyright (c), by Zend Technologies

Here is my apache server version

Server version: Apache/2.4.56 (Unix) Server built: Apr 15 2023 04:26:33

Here is my macos

13.4.1 (22F82) Ventura

FYI:

  • Php used to work in my machine couple of months ago , dunno what happened suddenly.
  • I have installed Visual studio in my mac and I'm able to execute python programs from Visual studio.
Amogam
  • 321
  • 5
  • 20
  • 1
    This should probably be asked on serverfault.com instead. – Olivier Jul 28 '23 at 20:13
  • That's just a configuration error. Follow the documentation, both the one from PHP and the one of the webserver you're using. You marry two systems so that they play well together, but not every relationship has a good start (or end). – hakre Jul 28 '23 at 22:43

1 Answers1

0

try adding LoadModule to your httpd.conf file.

Path is for example, change it to your apache configuration

LoadModule php_module /usr/local/opt/php/lib/httpd/modules/libphp8.2.so

Later, restart your apache and try again.

Melih Sevim
  • 930
  • 6
  • 9
  • I added the same in my httpd.conf file but the issue still remains.ofcourse I've restarted the apache webserver – Amogam Jul 28 '23 at 19:27
  • 1
    can you try also adding below line in httpd.conf; i see you only have index.html "DirectoryIndex index.php index.html" – Melih Sevim Jul 28 '23 at 21:59
  • 1
    @MelihSevim: Use comments to ask for clarification, e.g. if trying something would solve the problem. Don't post them as answers. – hakre Jul 29 '23 at 09:05
  • @MelihSevim - It's not working – Amogam Aug 01 '23 at 19:48