On 06/14/2016 05:54 PM, Ed Greshko wrote:
On 06/15/16 06:23, Rick Stevens wrote:
One other thing. By default, PHP no longer permits "short open tags". So all PHP code must be prefixed with
<?php php code goes here; ?>If all you have is
<? php code goes here; ?>then you must have "short_open_tag = On" in your /etc/php.ini (or in one of the files in /etc/php.d). By default it's set to "Off".
That didn't help. But I found something "interesting"
If I remove index.php and directly access a URL like http://localhost/index.php?action=contact I get "The requested URL /index.php was not found on this server." But if I copy index.php?action=contact to index-X.php and access http://localhost/index-X.php it displays properly in the browser.
Ok, that sounds like two possible issues:
1. Are you sure the code you got from the guy is installed in the document root for your Apache (check the "DocumentRoot" directive in your Apache config file) and that the files including the document root directory itself are all readable by Apache (the default is that Apache runs as user "apache", group "apache").
2. You may be using the default index directive which only uses "index.html" as the substitute for a directory listing.
a. Edit your httpd.conf file. Assuming a normal, repo-based install, this will be the "/etc/httpd/conf/httpd.conf" file.
b. You'll probably find a default section like:
<IfModule dir_module> DirectoryIndex index.html </IfModule>
in it. If you do, then change that second line to read something like:
DirectoryIndex index.html index.htm index.php
This causes the system to look for one of those three files if someone requests a directory listing, e.g. "http://your.server.com/" and serves it up in place of a directory listing.
c. Save the file.
d. Verify you have mod_dir.so:
ls /usr/lib[64]/httpd/modules/mod_dir.so
(obviously, use "/usr/lib" on 32-bit, "/usr/lib64" on 64-bit).
e. If you have all of that stuff, restart Apache and try to access the top level again:
See https://wiki.apache.org/httpd/DirectoryListings for more info on this last bit. ---------------------------------------------------------------------- - Rick Stevens, Systems Engineer, AllDigital ricks@alldigital.com - - AIM/Skype: therps2 ICQ: 226437340 Yahoo: origrps2 - - - - I haven't lost my mind. It's backed up on tape somewhere, but - - probably not recoverable. - ----------------------------------------------------------------------