I installed Apache and I am trying to open php files. I can do it with this:
… and it will only open the index.php file in the www-data directory.
But if I want to open up any other .php file I have to do:
This is wrong because I have type in the Name of the php file behind this:
How do I make this stick so that when I click on any .php file it will automatically open the web browser with the php web page in it.
Here is what I I'm using out the httpd.conf file. I don't know what I am missing or typed in the wrong way.
Happy Holidays
Code:
10.0.0.1:8080
But if I want to open up any other .php file I have to do:
Code:
http://10.0.0.1:8080/ex2.php
Code:
http://10.0.0.1:8080/
How do I make this stick so that when I click on any .php file it will automatically open the web browser with the php web page in it.
Here is what I I'm using out the httpd.conf file. I don't know what I am missing or typed in the wrong way.
Code:
ServerRoot "/usr/local"
Listen 10.0.0.1:8080
LoadModule authn_file_module libexec/apache24/mod_authn_file.so
LoadModule authn_core_module libexec/apache24/mod_authn_core.so
LoadModule authz_host_module libexec/apache24/mod_authz_host.so
LoadModule authz_groupfile_module libexec/apache24/mod_authz_groupfile.so
LoadModule authz_user_module libexec/apache24/mod_authz_user.so
LoadModule authz_core_module libexec/apache24/mod_authz_core.so
LoadModule access_compat_module libexec/apache24/mod_access_compat.so
LoadModule auth_basic_module libexec/apache24/mod_auth_basic.so
LoadModule reqtimeout_module libexec/apache24/mod_reqtimeout.so
LoadModule filter_module libexec/apache24/mod_filter.so
LoadModule mime_module libexec/apache24/mod_mime.so
LoadModule log_config_module libexec/apache24/mod_log_config.so
LoadModule env_module libexec/apache24/mod_env.so
LoadModule headers_module libexec/apache24/mod_headers.so
LoadModule setenvif_module libexec/apache24/mod_setenvif.so
LoadModule version_module libexec/apache24/mod_version.so
LoadModule mpm_prefork_module libexec/apache24/mod_mpm_prefork.so
LoadModule unixd_module libexec/apache24/mod_unixd.so
LoadModule status_module libexec/apache24/mod_status.so
LoadModule autoindex_module libexec/apache24/mod_autoindex.so
<IfModule !mpm_prefork_module>
#LoadModule cgid_module libexec/apache24/mod_cgid.so
#
</IfModule>
# ...........................................................................
<IfModule mpm_prefork_module>
#LoadModule cgi_module libexec/apache24/mod_cgi.so
</IfModule>
# ########################################################################### NEXT
# ########################################################################### GROUP
LoadModule dir_module libexec/apache24/mod_dir.so
LoadModule alias_module libexec/apache24/mod_alias.so
# Third party modules
IncludeOptional etc/apache24/modules.d/[0-9][0-9][0-9]_*.conf
<IfModule unixd_module>
User www
Group www
</IfModule>
# ###########################################################################
# ########################################################################### MAIN
# 'Main' server configuration
ServerAdmin max21@yahoo.com
ServerName localhost
<Directory />
AllowOverride none
Require all denied
</Directory>
# ######################################################################
# ###################################################################### DocumentRoot
DocumentRoot "/usr/local/www/apache24/data"
<Directory "/usr/local/www/apache24/data">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
# ################################################################## funny that 10.0.0.1:8080
# ################################################################## work if php is at the top
# ################################################################## and not if added at bottom.
DirectoryIndex *.php
DirectoryIndex index.html
DirectoryIndex index.htm
</IfModule>
# ####################################################################
# #################################################################### SECURITY
# Prevent .htaccess & .htpasswd files from being viewed by Web clients.
#
<Files ".ht*">
Require all denied
</Files>
# ####################################################################
# #################################################################### LOG ERROR
ErrorLog "/var/log/httpd-error.log"
# #################################################################### ERROR
# #################################################################### LOGLEVEL
LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "/var/log/httpd-access.log" common
</IfModule>
# #################################################################### tell clients
# #################################################################### REDIRECT
# #################################################################### doc moved
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/usr/local/www/apache24/cgi-bin/"
</IfModule>
# ####################################################################
# #################################################################### CGI
# #################################################################### ScriptSock
<IfModule cgid_module>
</IfModule>
<Directory "/usr/local/www/apache24/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
# ################################################################
# ################################################################ MINE extension
# ################################################################ to MIME-type
<IfModule mime_module>
TypesConfig etc/apache24/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
</IfModule>
# ################################################################
# ################################################################ MINE_MAGIC
# ################################################################
<IfModule proxy_html_module>
Include etc/apache24/extra/proxy-html.conf
</IfModule>
# ################################################################
# ################################################################ SSL/TLS
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
# .....................................................................
Include etc/apache24/Includes/*.conf
LoadModule php7_module libexec/apache24/libphp7.so
# ################################################################## at the end
# ################################################################## FilesMatch
# ...................
# ...................
<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>
Happy Holidays
Last edited by a moderator: