liunx學習及php環境搭建

2021-08-29 03:11:27 字數 4443 閱讀 9710

vmwareworkstation 12.5

xshell6_wm

centos-7-x86_64-minimal-1804

非常重要:伺服器禁止關機和重啟

linux系統中,一切皆檔案

2.查詢linux系統ip

ip addr

ifconfig (yum -y install net-tools)

3.系統目錄結構

bin    bin是binary的縮寫, 這個目錄存放著最經常使用的命令。

devhome   使用者的主目錄,在linux中,每個使用者都有乙個自己的目錄,一般該目錄名是以使用者的賬號命名的。

lib64

mntproc

runsrv

tmp    這個目錄是用來存放一些臨時檔案的。

var    這個目錄中存放著在不斷擴充著的東西,我們習慣將那些經常被修改的目錄放在這個目錄下。包括各種日誌檔案。

boot

etc     這個目錄用來存放所有的系統管理所需要的配置檔案和子目錄。

libmedia

optroot    該目錄為系統管理員,也稱作超級許可權者的使用者主目錄。

sbin    s就是super user的意思,這裡存放的是系統管理員使用的系統管理程式。

sysusr      這是乙個非常重要的目錄,使用者的很多應用程式和檔案都放在這個目錄下,類似於windows下的program files目錄。

4.常用命令

cat                                chmod

chown                              find

mv(move)                           rm(remove)

cp                                 touch

cd                                 ls(ls -l)

pwd                                df

du                                 ifconfig(yum -y install net-tools)

ping                               kill

ps                                 clear

tar                                mkdir     

l(linux)a(apache)m(mysql)p(php)安裝

安裝apache

yum安裝apache(httpd):yum install -y httpd httpd-devel

顯示complete(完畢)時,代表安裝成功

啟動apache服務

重啟apache服務

關閉apache服務

檢視apache服務狀態

firewalld防火牆

開啟systemctl start firewalld

重啟systemctl restart firewalld

關閉systemctl stop firewalld

檢視狀態

systemctl stauts firewalld

wget安裝

yum install -y wget

2. 安裝mysql源

yum localinstall mysql57-community-release-el7-8.noarch.rpm

3. 安裝mysql

yum install mysql-community-server

4. 管理mysql服務

啟動mysql服務

systemctl start mysqld

重啟mysql服務

systemctl restart mysqld

關閉mysql服務

systemctl stop mysqld

檢視mysql服務狀態

systemctl status mysqld

開機啟動mysql服務

systemctl enable mysqld

systemctl daemon-reload

禁止開機啟動mysql服務

systemctl disable mysqld

5. 修改預設密碼

grep 'temporary password' /var/log/mysqld.log

alter user 'root'@'localhost' identified by 'mynewpass4!';

set password for 'root'@'localhost'=password('mynewpass4!');

編譯安裝php

1. 安裝依賴擴充套件

yum -y install libxml2 libxml2-devel \

openssl openssl-devel bzip2 bzip2-devel \

libcurl libcurl-devel libjpeg libjpeg-devel \

libpng libpng-devel freetype freetype-devel \

gmp gmp-devel libmcrypt libmcrypt-devel \

readline readline-devel \

libxslt libxslt-devel gcc gcc-c++

2. 下php原始碼包

php.net/downloads.php

wget

3. 解壓原始碼包

tar -zxvf php-7.2.0.tar.gz

4. 進入解壓後的目錄

cd php7.2.0

5. 編譯配置

./configure --prefix=/usr/local/php72 \

--with-config-file-path=/usr/local/php72/etc \

--with-apxs2=/usr/bin/apxs \

--with-curl \

--with-freetype-dir \

--with-gd \

--with-jpeg-dir \

--with-gettext \

--with-iconv-dir \

--with-kerberos \

--with-libdir=lib64 \

--with-libxml-dir \

--with-mysqli \

--with-openssl \

--with-pcre-regex \

--with-pdo-mysql \

--with-pdo-sqlite \

--with-pear \

--with-png-dir \

--with-xmlrpc \

--with-xsl \

--with-zlib \

--enable-bcmath \

--enable-libxml \

--enable-inline-optimization \

--enable-gd-native-ttf \

--enable-mbregex \

--enable-mbstring \

--enable-opcache \

--enable-pcntl \

--enable-shmop \

--enable-soap \

--enable-sockets \

--enable-sysvsem \

--enable-xml \

--enable-zip

6. 編譯並且安裝

make && make install

配置httpd php

allowoverride none 修改為 allowoverride all

directoryindex index.html 修改為 directoryindex index.html index.php

重啟httpd

2. php

cp /root/php-7.2.0/php.ini-development /usr/local/php72/etc/php.ini

vim /usr/local/php72/etc/php.ini

重啟httpd

Liunx開發環境搭建

1 啟動 slickedit 乙個終端啟動 slickedit 後,它還執行著的情況下,另乙個終端再啟動 slickedit 時,需要敲命令 vs new 2 根據需要創鍵工程 a 新建工程 project new b 根據需要選擇要建立工程 這裡為 gnu c c c 可建立可執行程式 動態庫 靜...

LIUNX的環境搭建

linux 是乙個作業系統 安裝 vmware 虛擬機器 安裝final shell root root使用者的家目錄 home 使用者的加目錄 etc 系統的配置檔案 network 網路的配置檔案 怎麼敲命令?命令 選項 引數 檢視當前所在完整路徑 pwd 建立空白資料夾 mkdir 建立空白檔...

php環境搭建及入門

在php檔案裡,寫入header content type text html charset uft 8 header content type text html charset utf 8 echo hello world 中文 function sum a,b echo sum 1,2 在w...