{"id":32117,"date":"2022-12-26T21:29:25","date_gmt":"2022-12-26T13:29:25","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=32117"},"modified":"2022-12-26T21:29:42","modified_gmt":"2022-12-26T13:29:42","slug":"yum-lamp-easy","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/yum-lamp-easy.html","title":{"rendered":"\u65b0\u624b\u5fc5\u770b\uff0c\u8001\u9e1f\u7ed5\u9053–LAMP\u7b80\u6613\u5b89\u88c5"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nLAMP\u662f\u4f01\u4e1a\u4e2d\u6700\u5e38\u7528\u7684\u670d\u52a1\uff0c\u4e5f\u662f\u975e\u5e38\u7a33\u5b9a\u7684\u7f51\u7ad9\u67b6\u6784\u5e73\u53f0\u3002\u5176\u4e2dL-\u6307\u7684\u662fLinux\uff0cA-\u6307\u7684\u662fApache,m-\u6307\u7684\u662fmysql\u6216\u8005marriDB\uff0cp-php\u3002\u76f8\u4fe1\u5927\u5bb6\u5bf9\u8fd9\u4e9b\u90fd\u5df2\u7ecf\u975e\u5e38\u719f\u6089\u4e86\uff0c\u4f46\u662f\u5bf9\u4e8e\u521a\u63a5\u89e6Linux\u7684\u65b0\u624b\u6765\u8bf4\uff0c\u53ef\u80fd\u8fd8\u4e0d\u662f\u592a\u660e\u767d\uff0c\u8981\u88c5\u4ec0\u4e48\u5305\u554a\uff0c\u4ec0\u4e48\u6a21\u5757\u554a\u3002\u5176\u5b9eLAMP\u5e76\u4e0d\u96be\uff0c\u4e0b\u9762\u7528\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u5b89\u88c5LAMP\u3002
\n<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\u51c6\u5907\u5de5\u4f5c<\/strong><\/div>\n

\u7cfb\u7edf\u73af\u5883\uff1acentos 6.8 x86_64<\/p>\n

[root@localhost ~]# uname -a\r\nLinux localhost.localdomain 2.6.32-642.el6.x86_64 #1 SMP Tue May 10 17:27:01 UTC 2016 x86_64 x86_64 x86_64 GNU\/Linux\r\n[root@localhost ~]# cat \/etc\/redhat-release \r\nCentOS release 6.8 (Final)\r\n[root@localhost ~]# \r\n<\/pre>\n

LAMP\u76f8\u5173\u5305\u662f\u5426\u5b89\u88c5\uff1a
\n\u9ed8\u8ba4httpd\u5df2\u7ecf\u5b89\u88c5\uff0c\u5728\u8fd9\u91cc\u6211\u4eec\u8bf4\u660e\u4e0b\uff1a\u672c\u6b21\u5b9e\u9a8c\u6211\u4eec\u91c7\u7528\u7684\u662fyum\u7684\u65b9\u5f0f\u6765\u8fdb\u884c\u5b89\u88c5\uff0chttpd\u5c31\u662fApache\u8f6f\u4ef6\u5728RPM\u4e2d\u7684\u8f6f\u4ef6\u5305\u540d<\/p>\n

[root@localhost ~]# rpm -qa httpd\r\nhttpd-2.2.15-53.el6.centos.x86_64\r\n[root@localhost ~]# rpm -qa mysql*\r\n[root@localhost ~]# rpm -qa php*\r\n[root@localhost ~]# \r\n<\/pre>\n
L-A-M-P \u5b89\u88c5<\/strong><\/div>\n

LAMP\u7684\u5b89\u88c5\u5176\u5b9e\u975e\u5e38\u7b80\u5355\uff0c\u4e00\u6761\u547d\u4ee4\u641e\u5b9a\u3002\u4e2a\u4eba\u8ba4\u4e3a\u5bf9\u4e8e\u521d\u5b66\u7740\u6ca1\u6709\u5fc5\u8981\u641e\u90a3\u4e48\u591a\u8fd9\u4e2a\u63d2\u4ef6\uff0c\u90a3\u4e2a\u63d2\u4ef6\uff1b\u5230\u4e86\u6df1\u5165\u4e86\u89e3\u4e86LAMP\u540e\u5728\u6839\u636e\u81ea\u5df1\u5b9e\u9645\u7684\u9700\u6c42\u6765\u8fdb\u884c\u6a21\u5757\u7684\u5b89\u88c5\uff0c\u7531\u6613\u9053\u96be\uff0c\u5faa\u5e8f\u6e10\u8fdb\u7684\u5b66\u4e60\u3002<\/p>\n

yum\u4ed3\u5e93\u7684\u68c0\u67e5<\/strong><\/span><\/div>\n
[root@localhost ~]# yum repolist                 \\\\\u67e5\u770byum\u4ed3\u5e93\u7684\u60c5\u51b5\r\nLoaded plugins: fastestmirror, refresh-packagekit, security\r\nLoading mirror speeds from cached hostfile\r\n * base: mirrors.cn99.com\r\n * extras: mirrors.cn99.com\r\n * updates: mirrors.aliyun.com\r\nbase                                                               | 3.7 kB     00:00     \r\nextras                                                             | 3.4 kB     00:00     \r\nupdates                                                            | 3.4 kB     00:00     \r\nrepo id                             repo name                                 status\r\nbase                                CentOS-6 - Base                           6,696\r\nextras                              CentOS-6 - Extras                         62\r\nupdates                             CentOS-6 - Updates                        482\r\nrepolist: 7,240\r\n<\/pre>\n

\u6211\u4eec\u4f7f\u7528\u7684\u662fcentos\u9ed8\u8ba4\u7684\u7f51\u7edcyum\u4ed3\u5e93\uff0c\u5f53\u7136\u5982\u679c\u9ed8\u8ba4yum\u4ed3\u5e93\u6bd4\u8f83\u6162\u7684\u8bdd\uff0c\u53ef\u4ee5\u4f7f\u7528epel\u7684\u8f6f\u4ef6\u5305\u3002<\/p>\n

yum\u5b89\u88c5LAMP<\/strong><\/span><\/div>\n
[root@localhost ~]# yum -y install httpd mysql mysql-server mysql-devel php*\r\nLoaded plugins: fastestmirror, refresh-packagekit, security\r\nSetting up Install Process\r\nLoading mirror speeds from cached hostfile\r\n * base: mirrors.cn99.com\r\n * extras: mirrors.cn99.com\r\n * updates: mirrors.aliyun.com\r\nResolving Dependencies\r\n--> Running transaction check\r\n---> Package httpd.x86_64 0:2.2.15-53.el6.centos will be updated\r\n---> Package httpd.x86_64 0:2.2.15-54.el6.centos will be an update\r\n--> Processing Dependency: httpd-tools = 2.2.15-54.el6.centos for package: httpd-2.2.15-54.el6.centos.x86_64\r\n---> Package mysql.x86_64 0:5.1.73-7.el6 will be installed\r\n..........................\r\nInstalled:\r\n  mysql.x86_64 0:5.1.73-7.el6    mysql-devel.x86_64 0:5.1.73-7.el6    mysql-server.x86_64 0:5.1.73-7.el6     \r\n  php.x86_64 0:5.3.3-48.el6_8    php-bcmath.x86_64 0:5.3.3-48.el6_8   php-cli.x86_64 0:5.3.3-48.el6_8        \r\n .........\r\n\r\nUpdated:\r\n  httpd.x86_64 0:2.2.15-54.el6.centos                                                                                   \r\n\r\nDependency Updated:\r\n  httpd-tools.x86_64 0:2.2.15-54.el6.centos  net-snmp-libs.x86_64 1:5.5-57.el6_8.1  openssl.x86_64 0:1.0.1e-48.el6_8.1 \r\n\r\nComplete!\r\n<\/pre>\n

\u6211\u4eecyum\u547d\u4ee4\u5b89\u88c5httpd \uff0c\u5b89\u88c5mysql mysql-server \u548cmysql-devel\u5f00\u53d1\u5305\uff0c\u5728php\u7684\u5b89\u88c5\u5305\u4e0a\u9762\u6211\u4eec\u9009\u62e9\u4e86php* \u7684\u547d\u4ee4\u5339\u914d\u641c\u6709php\u76f8\u5173\u7684\u5305\u3002\u6ce8\u610f\uff0c\u6ce8\u610f\u7684\u64cd\u4f5c\u662f\u4e3a\u4e86\u8ba9\u5165\u95e8\u7ae5\u978b\u4eec\u5148\u4e86\u89e3LAMP\u7684\u65b9\u6848\uff0c\u5728\u6df1\u5165\u4e86\u89e3\u540e\uff0c\u8fd8\u662f\u8981\u8ddf\u8fdb\u5b9e\u9645\u7684\u60c5\u51b5\u5b89\u88c5\u641c\u9700\u8981\u7684\u5305\u3002<\/p>\n

LAMP\u521d\u59cb\u5316<\/strong><\/div>\n

\u5b89\u88c5\u5b8c\u6210LAMP\u540e\uff0c\u6211\u4eec\u9700\u8981\u5bf9LAMP\u8fdb\u884c\u521d\u59cb\u5316\uff0c\u5176\u5b9e\u4e5f\u5c31\u662f\u542f\u52a8\u670d\u52a1\uff0c\u5f00\u673a\u81ea\u8d77\u548c\u5fc5\u8981\u7684\u914d\u7f6e\u3002<\/p>\n

Apache\u7684\u521d\u59cb\u5316<\/strong><\/span><\/div>\n
[root@localhost ~]# service httpd start           \\\\\u542f\u52a8httpd\u670d\u52a1;\u6ce8\u610fhttpd\u548capache\u7684\u5173\u7cfb\r\nStarting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName\r\n                                                           [  OK  ]\r\n[root@localhost ~]# chkconfig httpd on             \\\\\u8bbe\u7f6ehttpd\u5f00\u542f\u81ea\u5668\r\n<\/pre>\n
mysql\u7684\u521d\u59cb\u5316<\/strong><\/span><\/div>\n
[root@localhost ~]# service mysqld start           \\\\\u5f00\u542fmysql\u670d\u52a1\uff0c\u4f1a\u63d0\u793a\u9700\u8981\u521d\u59cb\u5316\uff0c\u5f88\u8be6\u7ec6\r\nInitializing MySQL database:  Installing MySQL system tables...\r\nOK\r\nFilling help tables...\r\nOK\r\n\r\nTo start mysqld at boot time you have to copy\r\nsupport-files\/mysql.server to the right place for your system\r\n\r\nPLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !\r\nTo do so, start the server, then issue the following commands:\r\n\r\n\/usr\/bin\/mysqladmin -u root password 'new-password'\r\n\/usr\/bin\/mysqladmin -u root -h localhost.localdomain password 'new-password'\r\n\r\nAlternatively you can run:\r\n\/usr\/bin\/mysql_secure_installation\r\n\r\nwhich will also give you the option of removing the test\r\ndatabases and anonymous user created by default.  This is\r\nstrongly recommended for production servers.\r\n\r\nSee the manual for more instructions.\r\n\r\nYou can start the MySQL daemon with:\r\ncd \/usr ; \/usr\/bin\/mysqld_safe &\r\n\r\nYou can test the MySQL daemon with mysql-test-run.pl\r\ncd \/usr\/mysql-test ; perl mysql-test-run.pl\r\n\r\nPlease report any problems with the \/usr\/bin\/mysqlbug script!\r\n\r\n                                                           [  OK  ]\r\nStarting mysqld:                                           [  OK  ]\r\n[root@localhost ~]# chkconfig mysqld on                \\\\\u8bbe\u7f6emysql\u5f00\u673a\u81ea\u542f\u52a8\r\n[root@localhost ~]# mysqladmin -u root password lrxjmw.cn\r\n                            \\\\\u521d\u59cb\u5316mysql\uff0c\u5728\u8fd9\u91cc\u9700\u8981\u8bbe\u7f6emysql\u7684root\u7684\u5bc6\u7801\uff1b\u547d\u4ee4\uff1amysqladmin -u \u7528\u6237 password \u5bc6\u7801\r\n[root@localhost ~]# mysql -u root -p                    \\\\\u767b\u5f55mysql\u67e5\u770b\u662f\u5426\u80fd\u591f\u767b\u5f55        \r\nEnter password: \r\nWelcome to the MySQL monitor.  Commands end with ; or \\g.\r\nYour MySQL connection id is 3\r\nServer version: 5.1.73 Source distribution\r\n\r\nCopyright (c) 2000, 2013, Oracle and\/or its affiliates. All rights reserved.\r\n\r\nOracle is a registered trademark of Oracle Corporation and\/or its\r\naffiliates. Other names may be trademarks of their respective\r\nowners.\r\n\r\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\r\n\r\nmysql>                                             \\\\ok\u767b\u5f55\u6210\u529f\r\n<\/pre>\n

\u6ce8\u610f\uff1a\u5728yum\u5b89\u88c5lamp\u7684\u65f6\u5019\uff0c\u5176\u5b9ephp\u53ea\u662fapache\u7684\u4e00\u4e2a\u96c6\u6210\u7684\u7ec4\u4ef6\uff0c\u4e0d\u9700\u8981\u6dfb\u52a0\u6a21\u5757\u7684\u5e94\u7528\uff0c\u53ea\u8981\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u542f\u7528\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n

\u73af\u5883\u7b80\u5355\u7684\u6d4b\u8bd5<\/strong><\/div>\n
\u67e5\u770b\u7ecf\u5e38mysql\u548chttpd\u662f\u5426\u8fd0\u884c\uff1a<\/strong><\/span><\/div>\n
[root@localhost ~]# ps -aux |grep httpd               \\\\\u67e5\u770bhttpd\u7684\u8fdb\u7a0b\r\nWarning: bad syntax, perhaps a bogus '-'? See \/usr\/share\/doc\/procps-3.2.8\/FAQ\r\nroot      2930  0.0  2.9 487660 14664 ?        Ss   10:46   0:00 \/usr\/sbin\/httpd\r\napache    2933  0.0  1.9 487660  9400 ?        S    10:46   0:00 \/usr\/sbin\/httpd\r\napache    2934  0.0  1.8 487660  9112 ?        S    10:46   0:00 \/usr\/sbin\/httpd\r\napache    2935  0.0  1.9 487660  9400 ?        S    10:46   0:00 \/usr\/sbin\/httpd\r\napache    2936  0.0  1.9 487660  9392 ?        S    10:46   0:00 \/usr\/sbin\/httpd\r\napache    2937  0.0  1.8 487660  9116 ?        S    10:46   0:00 \/usr\/sbin\/httpd\r\napache    2938  0.0  1.8 487660  9136 ?        S    10:46   0:00 \/usr\/sbin\/httpd\r\napache    2939  0.0  1.8 487660  9112 ?        S    10:46   0:00 \/usr\/sbin\/httpd\r\napache    2940  0.0  2.3 487844 11840 ?        S    10:46   0:00 \/usr\/sbin\/httpd\r\nroot     10163  0.0  0.1 103316   868 pts\/3    S+   12:23   0:00 grep httpd\r\n[root@localhost ~]# ps -aux |grep mysql               \\\\\u67e5\u770bmysql\u7684\u76f8\u5173\u8fdb\u7a0b\r\nWarning: bad syntax, perhaps a bogus '-'? See \/usr\/share\/doc\/procps-3.2.8\/FAQ\r\nroot      3035  0.0  0.2 108216  1452 pts\/1    S    10:47   0:00 \/bin\/sh \/usr\/bin\/mysqld_safe --datadir=\/var\/lib\/mysql --socket=\/var\/lib\/mysql\/mysql.sock --pid-file=\/var\/run\/mysqld\/mysqld.pid --basedir=\/usr --user=mysql\r\nmysql     3137  0.0  4.3 367512 21444 pts\/1    Sl   10:47   0:02 \/usr\/libexec\/mysqld --basedir=\/usr --datadir=\/var\/lib\/mysql --user=mysql --log-error=\/var\/log\/mysqld.log --pid-file=\/var\/run\/mysqld\/mysqld.pid --socket=\/var\/lib\/mysql\/mysql.sock\r\nroot     10165  0.0  0.1 103316   868 pts\/3    S+   12:23   0:00 grep mysql\r\n\r\n[root@localhost ~]# netstat -tanulp |grep 80      \\\\\u67e5\u770bhttpd \u7684\u7aef\u53e3\u5bf9\u5916\u76d1\u542c\r\ntcp        0      0 192.168.1.108:50878         63.80.4.177:80              ESTABLISHED 2629\/clock-applet   \r\ntcp        0      0 :::80                       :::*                        LISTEN      2930\/httpd          \r\n[root@localhost ~]# netstat -tanulp |grep 3306     \\\\\u67e5\u770bmysql\u7684\u7aef\u53e3\u5bf9\u5916\u76d1\u542c\r\ntcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      3137\/mysqld    \r\n<\/pre>\n
\u9632\u706b\u5899\u7684\u76f8\u5173\u8bbe\u7f6e<\/strong><\/span><\/div>\n
[root@localhost ~]# iptables -L                   \\\\\u67e5\u770biptables\u7684\u89c4\u5219\r\nChain INPUT (policy ACCEPT)\r\ntarget     prot opt source               destination         \r\nACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED \r\nACCEPT     icmp --  anywhere             anywhere            \r\nACCEPT     all  --  anywhere             anywhere            \r\nACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh \r\nREJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited \r\n\r\nChain FORWARD (policy ACCEPT)\r\ntarget     prot opt source               destination         \r\nREJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited \r\n\r\nChain OUTPUT (policy ACCEPT)\r\ntarget     prot opt source               destination     \r\n\r\n[root@localhost ~]# iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT     \r\n                                     \\\\\u6dfb\u52a0iptables INPUT\u7684\u94fe\u7684\u7b2c\u4e00\u6761\u89c4\u5219\u5141\u8bb8tcp\u534f\u8bae\u768480\u7aef\u53e3\r\n                                  \\\\\u5173\u4e8eiptables \u7684\u66f4\u591a\u8bbe\u7f6e\uff0c\u8bf7\u53c2\u8003\u300alinux\u5c31\u8be5\u8fd9\u6837\u5b66\u300b<\/a>\u76f8\u5173\u5185\u5bb9\r\n\r\n[root@localhost ~]# service iptables save        \\\\\u5c06\u6211\u4eec\u7684\u6dfb\u52a0\u7684\u89c4\u5219\u4fdd\u5b58\u5728\u914d\u7f6e\u6587\u4ef6\r\niptables: Saving firewall rules to \/etc\/sysconfig\/iptables:[  OK  ]\r\n[root@localhost ~]# iptables -L                         \\\\\u67e5\u770b\u4fdd\u5b58\u60c5\u51b5\r\nChain INPUT (policy ACCEPT)\r\ntarget     prot opt source               destination         \r\nACCEPT     tcp  --  anywhere             anywhere            tcp dpt:http \r\nACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED \r\nACCEPT     icmp --  anywhere             anywhere            \r\nACCEPT     all  --  anywhere             anywhere            \r\nACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh \r\nREJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited \r\n\r\nChain FORWARD (policy ACCEPT)\r\ntarget     prot opt source               destination         \r\nREJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited \r\n\r\nChain OUTPUT (policy ACCEPT)\r\ntarget     prot opt source               destination         \r\n<\/pre>\n
\u6d4b\u8bd5httpd\u7684\u9759\u6001\u6587\u4ef6<\/strong><\/span><\/div>\n

\u6dfb\u52a0\u4e00\u4e2a\u6d4b\u8bd5\u7684\u9759\u6001index.html\u9875\u9762\uff0c\u6216\u8005\u4f7f\u7528\u9ed8\u8ba4\u7684\u9875\u9762\u8fdb\u884c\u6d4b\u8bd5\u3002\u5173\u4e8e\u6dfb\u52a0\u7f51\u7ad9\u9875\u9762\u7684\u66f4\u591a\u95ee\u9898\uff0c\u8bf7\u53c2\u8003\u300alinux\u5c31\u8be5\u8fd9\u6837\u5b66\u300b\u7684\u76f8\u5173\u5185\u5bb9<\/a><\/p>\n

[root@localhost ~]# echo \"hello word\" > \/var\/www\/html\/index.html\r\n<\/pre>\n

\u6d4b\u8bd5\u7528ie\u6d4f\u89c8\u5668\u6d4b\u8bd5\u9759\u6001\u9875\u9762\uff1a<\/p>\n

\"lamp-test-httpd1\"<\/p>\n

ok\uff0c\u6d4b\u8bd5\u6210\u529f\u3002<\/p>\n

\u914d\u7f6e\u6587\u4ef6<\/strong><\/span><\/div>\n
[root@localhost ~]# ls \/etc\/httpd\/              \\\\\u914d\u7f6e\u6587\u4ef6\u76ee\u5f55\uff0c\u76f8\u5173\u914d\u7f6e\u6a21\u5757\r\nconf\/    conf.d\/  logs\/    modules\/ run\/     \r\n[root@localhost ~]# vi \/etc\/httpd\/conf\/\r\nhttpd.conf  magic       \r\n[root@localhost ~]# vi \/etc\/httpd\/conf\/httpd.conf     \\\\\u4e3b\u914d\u6587\u4ef6\r\n[root@localhost ~]# wc -l \/etc\/httpd\/conf\/httpd.conf    \r\n1009 \/etc\/httpd\/conf\/httpd.conf\r\n                              \\\\ \u4e3b\u914d\u6587\u4ef6\u5171\u67091009\u884c\uff0c\u5176\u4e2d\u6709\u597d\u591a\u90fd\u662f\u6ce8\u91ca\u7684.\u517b\u6210\u597d\u4e60\u60ef\uff0c\u5907\u4efd\u9ed8\u8ba4\u914d\u7f6e\u6587\u4ef6\r\n[root@localhost ~]# tail \/etc\/httpd\/conf\/httpd.conf      \\\\\u66f4\u591a\u914d\u7f6e\u5efa\u8bae\u53c2\u8003\u300alinux\u5c31\u8be5\u8fd9\u6837\u5b66\u300b\u76f8\u5173\u5185\u5bb9<\/a>\r\n# The first VirtualHost section is used for requests without a known\r\n# server name.\r\n#\r\n#                                          \\\\\u914d\u7f6e\u6587\u4ef6\u4e2d\u6dfb\u52a0\u865a\u62df\u4e3b\u673a\u7684\u8bed\u53e5\r\n#    ServerAdmin webmaster@dummy-host.example.com\r\n#    DocumentRoot \/www\/docs\/dummy-host.example.com\r\n#    ServerName dummy-host.example.com\r\n#    ErrorLog logs\/dummy-host.example.com-error_log\r\n#    CustomLog logs\/dummy-host.example.com-access_log common\r\n#\r\n<\/pre>\n
\u9ad8\u7ea7\u73af\u5883\u7684\u6d4b\u8bd5<\/strong><\/div>\n

LAMP\u662f\u4e00\u4e2a\u7a33\u5b9a\u7684\u52a8\u6001\u7684\u7f51\u7ad9\u67b6\u6784\u65b9\u6848\uff0c\u5728\u8fd9\u91cc\u6211\u4eec\u9700\u8981\u6dfb\u52a0php\u7684\u652f\u6301\uff0c\u6d4b\u8bd5\u52a8\u6001\u7f51\u7ad9\u3002<\/p>\n

\u542f\u7528\u5bf9php\u7684\u652f\u6301<\/strong><\/span><\/div>\n
[root@localhost ~]# vi \/etc\/httpd\/conf\/httpd.conf \r\n\"add-http-php\"\r\n[root@localhost ~]# cat \/etc\/httpd\/conf\/httpd.conf |grep  DirectoryIndex     \r\n                                                  \\\\\u5728\u914d\u7f6e\u6587\u4ef6402\u884c\u6dfb\u52a0\u5bf9php\u9875\u9762\u7684\u652f\u6301\r\n# DirectoryIndex: sets the file that Apache will serve if a directory\r\n<\/pre>\n
\u6dfb\u52a0php\u6d4b\u8bd5\u9875\u9762\uff0c\u6d4b\u8bd5<\/strong><\/span><\/div>\n
[root@localhost ~]# vi \/var\/www\/html\/index.php    \r\n[root@localhost ~]# cat \/var\/www\/html\/index.php    \\\\\u6dfb\u52a0php\u4fe1\u606f\u7684\u6d4b\u8bd5\u9875\u9762\r\n\r\n[root@localhost ~]# vi \/var\/www\/html\/test.php\r\n[root@localhost ~]# cat \/var\/www\/html\/test.php      \\\\\u6dfb\u52a0php\u9875\u9762\u6d4b\u8bd5\r\ntest \r\nthis php test\r\n\r\n<\/pre>\n

\u6d4b\u8bd5\uff1a
\n\"test\"<\/p>\n

\"test-php2\"<\/p>\n

 <\/p>\n

\u6ce8\u610f\uff1a
\n\u52a8\u6001\u7f51\u9875\u642d\u5efa\u52a8\u65cf\u8bba\u575b \u8fc7\u7a0b\u7565\uff0c\u5927\u5bb6\u81ea\u5df1\u6d4b\u8bd5
\nApache\uff1ahttpd\uff08\u670d\u52a1\u540d\uff09 80 \uff08\u7aef\u53e3\uff09
\nMysql\uff1a mysqld\uff08\u670d\u52a1\u540d\uff09 3306\uff08\u7aef\u53e3\uff0c\u9ed8\u8ba4\u53ea\u5bf9\u672c\u5730\u76d1\u542c\uff09
\nphp\uff1a\u5728apache \u4e2d\u96c6\u6210\uff0c\u53ea\u9700\u6dfb\u52a0\u542f\u7528php\u9ed8\u8ba4\u6587\u6863\u5373\u53ef
\nlamp\u7684\u65e5\u5fd7\u7b49\u529f\u80fd\uff0c\u5efa\u8bae\u67e5\u770b
\u76f8\u5173\u6587\u6863<\/a>
\n\u5efa\u8bae\u5b89\u88c5lamp\u4e3a\u4e86\u8ba9\u5165\u95e8\u7ae5\u978b\u66f4\u52a0\u5bb9\u6613\u4e86\u89e3lamp\uff0c\u751f\u4ea7\u73af\u5883\u8981\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u5b89\u88c5\u4e0d\u901a\u7684\u7ec4\u4ef6\u3002<\/p>\n

LAMP\uff0cso easy\uff01\uff01\uff01<\/p><\/blockquote>\n

 <\/p>\n

\n

\u672c\u6587\u539f\u521b\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/yum-lamp-easy.html<\/a>\u4f5c\u8005\uff1a\u9676\u6b66\u6770\uff0c\u5ba1\u6838\u5458\uff1a\u51af\u742a<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb LAMP\u662f\u4f01\u4e1a\u4e2d\u6700\u5e38\u7528\u7684\u670d\u52a1\uff0c\u4e5f\u662f\u975e\u5e38\u7a33\u5b9a\u7684\u7f51\u7ad9\u67b6\u6784\u5e73\u53f0\u3002\u5176\u4e2dL-\u6307\u7684\u662fLinux\uff0cA-\u6307\u7684\u662fApach […]<\/p>\n","protected":false},"author":63,"featured_media":32179,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-32117","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/32117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=32117"}],"version-history":[{"count":11,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/32117\/revisions"}],"predecessor-version":[{"id":260327,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/32117\/revisions\/260327"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/32179"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=32117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=32117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=32117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}