微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在Apache Fedora上启用PHP?

标题几乎总结了它。 我运行Fedora 18 64位 ,通过“httpd”安装Apache。 我有我的Apache运行得很好,但我的PHP似乎并没有工作。 我相当肯定我有我的机器上安装(新的Linux)。

我在包含代码的/var/www/html/目录下创build了一个'test.PHP'文件: <?PHP PHPinfo(); ?> 但是它并没有显示出应该的样子,只是将文本打印到我的浏览器中。

所以我的想法是,PHP没有在我的Apacheconfiguration或什么东西。 有人可以对此有所了解,并对如何使这个工作有一些build议吗?

提前致谢!

如何更改厨师Nginx认HTTP端口80?

我如何使用.htaccess来隐藏.PHPurl的扩展名?

如何从FTP下载文件而不下载它们?

.htaccess将“/book.PHP?id=1234”改写为“/ book / 1234”

如何获得使用PHP的服务器的本地IP地址?

编辑,这是我的httpd.config文件

ServerRoot "/etc/httpd" Listen 80 Include conf.modules.d/*.conf User apache Group apache ServerAdmin root@localhost <Directory /> AllowOverride none Require all denied </Directory> DocumentRoot "/var/www/html" <Directory "/var/www"> AllowOverride None Require all granted </Directory> <Directory "/var/www/html"> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> <IfModule dir_module> DirectoryIndex index.html </IfModule> <Files ".ht*"> Require all denied </Files> ErrorLog "logs/error_log" 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 "logs/access_log" combined </IfModule> <IfModule alias_module> ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" </IfModule> <Directory "/var/www/cgi-bin"> AllowOverride None Options None Require all granted </Directory> <IfModule mime_module> TypesConfig /etc/mime.types AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddType text/html .shtml AddOutputFilter INCLUDES .shtml </IfModule> AddDefaultCharset UTF-8 MIMEMagicFile conf/magic EnableSendfile on IncludeOptional conf.d/*.conf

PHP网站的Git结帐?

我可以使用mod_rewrite更改文件扩展名? .jpeg为.jpg例如

如何使用PHP在URL中传递URL(作为GET参数)?

我如何连接到MysqLMysqL

通过Apache服务页面访问socket.io服务器

你可能会遇到一些问题是你没有为Apache定义“.PHP”索引

喜欢这个

<Ifmodulee mime_module> AddType text/html .PHP .PHPs </Ifmodulee>

看到这个教程安装Apache和PHP

并安装Apache和PHP

yum install PHP

重新启动Apache。

再试一次。

PHP需要自己安装。 它不是一个Apache模块,只需启用,而不先安装PHP

我通过重新安装httpd&PHP解决这个问题。 然后PHP文件正在执行。

显然,PHP是作为一个包安装的,但通过一个模块解释为apache:即; mod_PHP的。 这是一个猜想,我刚刚发现了一种嵌入HTML的方法

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐