GNU/Linux >> LINUX-Kenntnisse >  >> Cent OS

Arbeiten mit PHP 7x und mssql-Server auf Centos 8

Schritte:

  1. Mssql-Server auf dem DB-Server installieren und einrichten
  2. Installieren Sie PHP und Abhängigkeiten auf dem PHP-Server

Remi-Repo aktivieren

sudo dnf install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm

Stellen Sie sicher, dass alles auf dem neuesten Stand ist

sudo dnf update

Stellen Sie sicher, dass keine früheren oder andere PHP-Versionen vorhanden sind

dnf module reset php -y
dnf erase php php70 -y

Sobald dies abgeschlossen ist, installieren Sie PHP und Abhängigkeiten

dnf install php70 -y
dnf install -y \
    php70-php-fpm \ # to serve php content
    php70-php-pdo \ # for db connectivity
    php70-php-pear \ # to manage php deps with pecl
    php70-php-devel \ # for dev and header files required for installation from source
    php70-php-json \
    php70-php-mbstring \
    php70-php-gd \
    php70-php-xml \
    php70-php-zip

Überprüfen Sie die INI-Standortdateien

php70 --inic

Dies ist meine Ausgabe

$ php70 --ini
Configuration File (php.ini) Path: /etc/opt/remi/php70
Loaded Configuration File:         /etc/opt/remi/php70/php.ini
Scan for additional .ini files in: /etc/opt/remi/php70/php.d
Additional .ini files parsed:      /etc/opt/remi/php70/php.d/20-bz2.ini,
/etc/opt/remi/php70/php.d/20-calendar.ini,
/etc/opt/remi/php70/php.d/20-ctype.ini,
/etc/opt/remi/php70/php.d/20-curl.ini,
/etc/opt/remi/php70/php.d/20-dom.ini,
/etc/opt/remi/php70/php.d/20-exif.ini,
/etc/opt/remi/php70/php.d/20-fileinfo.ini,
/etc/opt/remi/php70/php.d/20-ftp.ini,
/etc/opt/remi/php70/php.d/20-gd.ini,
/etc/opt/remi/php70/php.d/20-gettext.ini,
/etc/opt/remi/php70/php.d/20-iconv.ini,
/etc/opt/remi/php70/php.d/20-json.ini,
/etc/opt/remi/php70/php.d/20-mbstring.ini,
/etc/opt/remi/php70/php.d/20-pdo.ini,
/etc/opt/remi/php70/php.d/20-phar.ini,
/etc/opt/remi/php70/php.d/20-posix.ini,
/etc/opt/remi/php70/php.d/20-shmop.ini,
/etc/opt/remi/php70/php.d/20-simplexml.ini,
/etc/opt/remi/php70/php.d/20-sockets.ini,
/etc/opt/remi/php70/php.d/20-sqlite3.ini,
/etc/opt/remi/php70/php.d/20-sqlsrv.ini,
/etc/opt/remi/php70/php.d/20-sysvmsg.ini,
/etc/opt/remi/php70/php.d/20-sysvsem.ini,
/etc/opt/remi/php70/php.d/20-sysvshm.ini,
/etc/opt/remi/php70/php.d/20-tokenizer.ini,
/etc/opt/remi/php70/php.d/20-xml.ini,
/etc/opt/remi/php70/php.d/20-xmlwriter.ini,
/etc/opt/remi/php70/php.d/20-xsl.ini,
/etc/opt/remi/php70/php.d/30-pdo_sqlite.ini,
/etc/opt/remi/php70/php.d/30-pdo_sqlsrv.ini,
/etc/opt/remi/php70/php.d/30-wddx.ini,
/etc/opt/remi/php70/php.d/30-xmlreader.ini,
/etc/opt/remi/php70/php.d/30-zip.ini

Die Haupt-PHP-INI-Datei finden Sie an diesem Ort hier /etc/opt/remi/php70/php.ini

PHP Home wird auf:

gesetzt
/opt/remi/php70/root/

Binärdateien hier

/opt/remi/php70/root/usr/bin/

Mssql-Abhängigkeiten installieren

Repository hinzufügen:

curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo

Installieren Sie dann

sudo ACCEPT_EULA=Y yum install msodbcsql17
sudo dnf install -y unixODBC-devel

SQL-Server-Treiber installieren. Neue Versionen funktionieren nicht, da dies eine alte Version von PHP ist.

/opt/remi/php70/root/usr/bin/pecl install sqlsrv-5.3.0
/opt/remi/php70/root/usr/bin/pecl install pdo_sqlsrv-5.3.0

So aktivieren Sie die Treiber:

cat > /etc/opt/remi/php70/php.d/20-sqlsrv.ini <<EOF
extension=sqlsrv.so
EOF

cat > /etc/opt/remi/php70/php.d/30-pdo_sqlsrv.ini <<EOF
extension=pdo_sqlsrv.so
EOF

Starten Sie dann php-fpm

neu
systemctl restart php70-php-fpm

Cent OS
  1. Downgrade der PHP-Version von 5.3 auf 5.2 in Centos6

  2. So installieren Sie PHP 7.4, 7.3, 7.2 auf CentOS 7 und RHEL 7 Server

  3. Installieren und richten Sie PHP ein, um eine Verbindung zu MsSQL Server Centos 8 herzustellen

  4. Installieren Sie Zenario mit Apache, PHP und MariaDB auf CentOS 7

  5. Wie kann ich die Datei /etc/shadow und /etc/passwd mit Auditd auf Änderungen überwachen?

So installieren und konfigurieren Sie den Caddy-Webserver mit PHP unter Fedora 34 / CentOS 8

Der perfekte Server CentOS 8 mit Apache, PHP, Postfix, Dovecot, Pure-FTPD, BIND und ISPConfig 3.2

So installieren Sie Open-audit unter CentOS 6/7

So installieren Sie Lighttpd mit PHP FPM und MariaDB unter CentOS 7 / RHEL 7

So installieren Sie Lighttpd mit PHP und MariaDB unter CentOS 7

Installieren von Apache und PHP unter CentOS 8