cool hit counter Apache and PHP combined_Intefrankly

Apache and PHP combined


apache and PHP combined

Configuring httpd to support PHP

ServerName

Require all denied

AddType application/x-httpd-php .php // parsePHP

DirectoryIndex index.html index.php

[root@shuai-01 ~]# vim /usr/local/apache2.4/conf/httpd.conf

1

2

modify

Find the ServerName line and uncomment it

Find Require all.

AllowOverride none

Require all granted

Require all granted

1

2

3

4

5

6

7

find

AddType application/x-compress .Z

AddType application/x-gzip .gz .tgz

increase

AddType application/x-httpd-php .php

1

2

find

DirectoryIndex index.html

1

2

3

4

be added as

DirectoryIndex index.html index.php

1

2

3

4

Detecting configuration file syntax errors

[root@shuai-01 ~]# /usr/local/Apache2.4/bin/apachectl -t

Syntax OK

1

2

3

Reload the configuration file

[root@shuai-01 ~]# /usr/local/Apache2.4/bin/apachectl graceful

1

2

Configuration successful

Accessing PHP is actually accessing (/usr/local/apache2.4/htdocs/*.php)

Write a 1.php file in that directory

[root@shuai-01 ~]# vi /usr/local/apache2.4/htdocs/1.php

phpinfo();

?>

1

2

3

4

5

6

Save to exit and start accessing

Pages that can be interpreted 1 out are successful, those that cannot are the page source code

Troubleshooting problems not explained

1, check if there is a PHP5 module loaded

[root@shuai-01 ~]# /usr/local/apache2.4/bin/apachectl -M

1

2

2, no module loaded, see if there is a module file

[root@shuai-01 ~]# ls /usr/local/apache2.4/modules/libphp5.so

/usr/local/apache2.4/modules/libphp5.so

1

2

3

3, check the configuration file to see if libphp5.so is loaded

[root@shuai-01 ~]# vim /usr/local/apache2.4/conf/httpd.conf

LoadModule php5_module modules/libphp5.so

1

2

3

4

4, see if the configuration file adds

AddType application/x-httpd-php .php

Question 1.

Possible errors that may be reported when the Apache service is turned on

Write the configuration file (/usr/local/apache2.4/conf/httpd.conf).

Find the ServerName line and uncomment it

Question 2.

Possible errors that may be reported when the Apache service is turned on

/usr/local/apache2.4/bin/apachectl: line 79: 3519 paragraph error $HTTPD -k $ARGV

1

2

It's that you run two PHP modules, comment out one.

LoadModule php5_module modules/libphp5.so

#LoadModule php7_module modules/libphp7.so

1

2

3

Question 3.

Exclusion method.

1, see if the IP is through.

IP pass, then see if port 80 is open

Because Windows does not have a Telnet client open

Open client

Control Panel - Programs - Turn Windows features on or off

This is where Telnet is opened, but it doesn't go through (no iptables rules on the server)

Adding rules in linux

[root@shuai-01 ~]# iptables -I INPUT -p tcp --dport 80 -j ACCEPT

1

2

Well that's it for today Moe, watch out below yo!


Recommended>>
1、The vivoX21 doesnt just have an underscreen fingerprint it also has jovi artificial intelligence
2、Notice on the 2018 Hunan Province Robotics Competition
3、Illegal mining has become a new threat to the Internet and your computer may be making money for someone else
4、Factor analysis and python implementation II
5、How much network value is driven by Huaweis IBN rampup

    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号