尊龙凯时人生就是博

CentOS 7ÉϴwebЧÀÍÆ÷µÄ³£¼û¹ýʧ¼°½â¾öÒªÁì

CentOS 7ÉϴwebЧÀÍÆ÷µÄ³£¼û¹ýʧ¼°½â¾öÒªÁì

ÔڴwebЧÀÍÆ÷µÄÀú³ÌÖÐ £¬³£³ £»áÓöµ½Ò»Ð©¹ýʧºÍÎÊÌâ¡£±¾ÎĽ«ÏÈÈݳ£¼ûµÄ¹ýʧÒÔ¼°½â¾öÒªÁì £¬²¢ÌṩÏìÓ¦µÄ´úÂëʾÀý¡£Ï£ÍûÄܹ»×ÊÖú¶ÁÕßÔÚCentOS 7ÉÏ˳Ëì´î½¨ºÍÔËÐÐwebЧÀÍÆ÷¡£

¹ýʧ1£ºÎÞ·¨Æô¶¯ApacheЧÀÍ

½â¾öÒªÁ죺

È·±£ApacheÒѾ­×¼È·×°Ö᣿ÉÒÔʹÓÃÒÔÏÂÏÂÁî¾ÙÐÐ×°ÖÃ:

sudo yum install httpd

µÇ¼ºó¸´ÖÆ

Æô¶¯ApacheЧÀÍ£º

sudo systemctl start httpd

µÇ¼ºó¸´ÖÆ

¼ì²éApacheÊÇ·ñÒѾ­ÀÖ³ÉÆô¶¯£º

sudo systemctl status httpd

µÇ¼ºó¸´ÖÆ

ÈôÊÇApacheÆô¶¯Ê§°Ü £¬¿ÉÒÔ¼ì²éÈÕÖ¾Îļþ¾ÙÐÐÅŲé £¬²¢Æ¾Ö¤Ïêϸ¹ýʧÐÅÏ¢¾ÙÐÐÐÞ¸´¡£

¹ýʧ2£º»á¼ûÍøվʱ·ºÆð”403 Forbidden”¹ýʧ

½â¾öÒªÁ죺

¼ì²éÍøÕ¾¸ùĿ¼£¨Í¨³£Îª/var/www/html£©µÄȨÏÞÊÇ·ñ׼ȷÉèÖ᣿ÉʹÓÃÒÔÏÂÏÂÁîÐÞ¸ÄȨÏÞ£º

sudo chmod -R 755 /var/www/html

µÇ¼ºó¸´ÖÆ

¼ì²éApacheÉèÖÃÎļþÖеÄȨÏÞÉèÖᣱ༭ÉèÖÃÎļþ£¨Í¨³£Îª/etc/httpd/conf/httpd.conf£© £¬ÕÒµ½ÒÔ϶ÎÂ䲢ȷ±£AllowOverrideºÍRequire¾ùÉèÖÃΪ”all”£º

<Directory "/var/www/html">
 AllowOverride all
 Require all granted
</Directory>

µÇ¼ºó¸´ÖÆ

ÖØÐÂÆô¶¯ApacheЧÀÍ£º

sudo systemctl restart httpd

µÇ¼ºó¸´ÖÆ

¹ýʧ3£º»á¼ûÍøվʱ·ºÆð”500 Internal Server Error”¹ýʧ

½â¾öÒªÁ죺

¼ì²éÍøÕ¾´úÂëÖÐÊÇ·ñ±£´æÓï·¨¹ýʧ¡£¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÀ´¼ì²éPHP´úÂëµÄÓï·¨ÊÇ·ñ׼ȷ£º

php -l /path/to/your/code.php

µÇ¼ºó¸´ÖÆ

¼ì²éApacheÉèÖÃÎļþÖеĹýʧÈÕ־·¾¶¡£Ä¬ÈÏÇéÐÎÏ £¬¹ýʧÈÕ־·¾¶Îª/var/log/httpd/error_log¡£¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÉó²é¹ýʧÈÕÖ¾£º

tail -f /var/log/httpd/error_log

µÇ¼ºó¸´ÖÆ

ƾ֤¹ýʧÈÕÖ¾ÖеÄÏêϸ¹ýʧÐÅÏ¢¾ÙÐÐÐÞ¸´¡£

ÒÔÉÏÊÇһЩÔڴwebЧÀÍÆ÷Àú³ÌÖг£¼ûµÄ¹ýʧ¼°½â¾öÒªÁ졣ϣÍûÕâЩ½â¾ö¼Æ»®Äܹ»×ÊÖú¶ÁÕß½â¾öÎÊÌâ £¬²¢Ë³ËìÍê³É×Ô¼ºµÄwebЧÀÍÆ÷´î½¨ÊÂÇé¡£ÔÚ½â¾öÎÊÌâʱ £¬¿Éƾ֤Ïêϸ¹ýʧÐÅÏ¢¾ÙÐÐÅŲé £¬Ò²¿É²Î¿¼±¾ÎÄÌṩµÄ½â¾öÒªÁìºÍ´úÂëʾÀý¾ÙÐÐÐÞ¸´¡£×£´î½¨Ë³Ë죡

ÒÔÉϾÍÊÇCentOS 7ÉϴwebЧÀÍÆ÷µÄ³£¼û¹ýʧ¼°½â¾öÒªÁìµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í尊龙凯时人生就是博ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ尊龙凯时人生就是博ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是博

13452372176

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
sitemap¡¢ÍøÕ¾µØͼ