New Install: How to enable PHP?
I have just completed a new install of Slackware 14.2-64 I'm trying to get back the capabilities of my previous Slackware install. The problem I'm dealing with at this moment is I can't seem to run php through apache. My test file (<php>phpinfo(); </php>) only shows text. I have gone into the apache config file and deleted the # before the Include of mod_php.conf. Rebooted apache. Nothing. My test file displays phpinfo(); I was expecting it to execute the command. It did not. Why did it not?
|
How is your test file named? If I remember right, by default, it needs to end in .php for it to be parsed by php.
Also, what happens if you run php -f /location/to/test.php |
Code:
root@caitlyn:/var/www/htdocs# php -f /var/www/htdocs/index.php |
you need to read up on the apache modules configuration for php. Maybe take a peek at
http://www.slackware.com/~mrgoblin/slackware-lamp2.php https://docs.slackware.com/howtos:ne...ache_php_mysql |
Try nmapping yourself like this:
Code:
nmap -sV 127.0.0.1 80/tcp open http Apache httpd 2.4.41 ((Unix) PHP/7.4.4) Next, try this in your index.php instead: Code:
<?php |
Quote:
https://www.php.net/manual/en/langua...ax.phptags.php https://www.php.net/manual/en/langua...ax.phpmode.php |
Yeah. My PHP is a bit rusty. I corrected the PHP, and then it worked! Thank you to all who have helped me in this thread.
|
All times are GMT -5. The time now is 06:55 PM. |