search
HomeBackend DevelopmentPHP TutorialLAMP网站平台的构建和PHP应用部署

LAMP是目前最成熟的一种企业网站应用模式,可提供动态web站点应用及开发环境

构成组件:Linux 、Apache、MySQL、PHP/Perl/Python

公司需求:

     搭建一台可以支持动态web站点 的网站,并且可以支持PHP语言开发的环境,通过PHP部署一个论坛系统。

需求的环境:

     系统:Red Hat Enterprise Linux Server release 6.5 (Santiago)

     web服务器软件:Apache

     支持动态网站的数据库:MYSQL

     支持动态网站的开发语言:PHP

     论坛的软件包:Discuz_X3.1_SC_GBK.zip

     提供Apache服务:httpd

     提供MYSQL服务软件包:mysql mysql-service

     提供PHP服务软件包:php php-mysql

     服务器IP:192.168.1.70

     客户端IP:192.168.1.60

搭建LAMP的环境

1.首先查看是否所有的软件包是否已经安装

2.安装没有安装软件包

3.安装完毕软件包后查看所有服务是否已经开启,随系统开启而自动启动。

4.修改数据库的密码

(查看数据库 的密码)

(登陆 数据库)

(修改数据库 的密码)

5.配置PHP(更改字符集)

6.在服务器端添加一个用PHP语言写的test1.php

7.启动服务

8.在客户机上测试(192.168.1.60)

PHP应用部署(Discuz!论坛系统)

在数据库上授权一个用户可以在数据库上进行操作

1.登陆数据库


2.查看数据库上的所有库

3.创建一个数据库用来 存放论坛的数据


4.授权一个(fanxh)用户登陆系统可以对数据库进行更改权限

5.部署论坛网页代码

解压软件 包Discuz_X3.1_SC_GBK.zip,出现以下内容说明没有安装unzip软件包,通过YUM进行安装。

解压软件包

查看解压后的所有内容,并且复制upload到默认的网页下

查看upload下的所有内容

6.安装论坛系统http://192.168.1.70/bbs/install

在客户端浏览器上输入

然后点击同意进行下一步设置

发现对目录和文件都没有权限,所以对/var/www/html/bbs/一些添加属主为apache( 在服务器上192.168.1.70上更改)


刷新客户机浏览器的页面,出现以下页面 说明安装正常,然后点击请将以上红叉部分修正再试。


在实验中 出现了,mysqli_connect() 不支持的,我看了很多资料,有了解决的办法,希望给同样学习的人一些经验。以下为解决 的办法

修改php的主配置文件把808行添加注释然后从新启动httpd服务就可以解决。


在客户机上192.168.1.60刷新页面就可以就达到下面的界面,然后点击下一步。

进入下面界面点击下一步

点击权限安装Discuz,数据库写刚才创建的数据库,用户名为授权的用户名,数据库密码为授权用户的密码,点击下一步就创建完毕。

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Optimize PHP Code: Reducing Memory Usage & Execution TimeOptimize PHP Code: Reducing Memory Usage & Execution TimeMay 10, 2025 am 12:04 AM

TooptimizePHPcodeforreducedmemoryusageandexecutiontime,followthesesteps:1)Usereferencesinsteadofcopyinglargedatastructurestoreducememoryconsumption.2)LeveragePHP'sbuilt-infunctionslikearray_mapforfasterexecution.3)Implementcachingmechanisms,suchasAPC

PHP Email: Step-by-Step Sending GuidePHP Email: Step-by-Step Sending GuideMay 09, 2025 am 12:14 AM

PHPisusedforsendingemailsduetoitsintegrationwithservermailservicesandexternalSMTPproviders,automatingnotificationsandmarketingcampaigns.1)SetupyourPHPenvironmentwithawebserverandPHP,ensuringthemailfunctionisenabled.2)UseabasicscriptwithPHP'smailfunct

How to Send Email via PHP: Examples & CodeHow to Send Email via PHP: Examples & CodeMay 09, 2025 am 12:13 AM

The best way to send emails is to use the PHPMailer library. 1) Using the mail() function is simple but unreliable, which may cause emails to enter spam or cannot be delivered. 2) PHPMailer provides better control and reliability, and supports HTML mail, attachments and SMTP authentication. 3) Make sure SMTP settings are configured correctly and encryption (such as STARTTLS or SSL/TLS) is used to enhance security. 4) For large amounts of emails, consider using a mail queue system to optimize performance.

Advanced PHP Email: Custom Headers & FeaturesAdvanced PHP Email: Custom Headers & FeaturesMay 09, 2025 am 12:13 AM

CustomheadersandadvancedfeaturesinPHPemailenhancefunctionalityandreliability.1)Customheadersaddmetadatafortrackingandcategorization.2)HTMLemailsallowformattingandinteractivity.3)AttachmentscanbesentusinglibrarieslikePHPMailer.4)SMTPauthenticationimpr

Guide to Sending Emails with PHP & SMTPGuide to Sending Emails with PHP & SMTPMay 09, 2025 am 12:06 AM

Sending mail using PHP and SMTP can be achieved through the PHPMailer library. 1) Install and configure PHPMailer, 2) Set SMTP server details, 3) Define the email content, 4) Send emails and handle errors. Use this method to ensure the reliability and security of emails.

What is the best way to send an email using PHP?What is the best way to send an email using PHP?May 08, 2025 am 12:21 AM

ThebestapproachforsendingemailsinPHPisusingthePHPMailerlibraryduetoitsreliability,featurerichness,andeaseofuse.PHPMailersupportsSMTP,providesdetailederrorhandling,allowssendingHTMLandplaintextemails,supportsattachments,andenhancessecurity.Foroptimalu

Best Practices for Dependency Injection in PHPBest Practices for Dependency Injection in PHPMay 08, 2025 am 12:21 AM

The reason for using Dependency Injection (DI) is that it promotes loose coupling, testability, and maintainability of the code. 1) Use constructor to inject dependencies, 2) Avoid using service locators, 3) Use dependency injection containers to manage dependencies, 4) Improve testability through injecting dependencies, 5) Avoid over-injection dependencies, 6) Consider the impact of DI on performance.

PHP performance tuning tips and tricksPHP performance tuning tips and tricksMay 08, 2025 am 12:20 AM

PHPperformancetuningiscrucialbecauseitenhancesspeedandefficiency,whicharevitalforwebapplications.1)CachingwithAPCureducesdatabaseloadandimprovesresponsetimes.2)Optimizingdatabasequeriesbyselectingnecessarycolumnsandusingindexingspeedsupdataretrieval.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment