It sounds like you may not have properly configured your Apache HTTP server to handle PHP files.
In order to serve PHP files with Apache, you will need to have the mod_php74 module installed and enabled. If you have already installed mod_php74, you can check if it is enabled by running the following command:
Copy code
apachectl -M | grep php
If mod_php74 is listed in the output, it means that it is enabled. If it is not listed, you will need to enable it by adding the following line to your Apache configuration file (usually located at /usr/local/etc/apache24/httpd.conf):
Copy code
LoadModule php7_module modules/mod_php74.so
After making this change, you will need to restart the Apache server in order for the change to take effect. You can do this by running the following command:
Copy code
service apache24 restart
Once Apache is configured to handle PHP files, you should be able to access PHP files through your web browser by visiting the URL of the PHP file. For example, if your PHP file is located at /usr/local/www/apache24/data/test.php, you should be able to access it by visiting
http://your-server-ip/test.php.
If you are still having trouble after following these steps, you may want to check the Apache error log (usually located at /var/log/httpd-error.log) for any error messages that may provide more information about the problem.