目次
apache をインストールする
2. 再コンパイルするだけ
含まれるもの: libpng、freetype、jpeg、gd
freetypeをインストールする
tar zxf freetype-2.4.10.tar.gz cd freetype-2.4.10 ./configure \ --prefix=/usr/local/services/php-5.4.39/plugins/freetype-2.4.10
ログイン後にコピー
" >
tar zxf freetype-2.4.10.tar.gz cd freetype-2.4.10 ./configure \ --prefix=/usr/local/services/php-5.4.39/plugins/freetype-2.4.10
ログイン後にコピー
tar zxf jpegsrc.v7.tar.gz cd jpeg-7 ./configure \ --prefix=/usr/local/services/php-5.4.39/plugins/jpeg-7
ログイン後にコピー
" >
tar zxf jpegsrc.v7.tar.gz cd jpeg-7 ./configure \ --prefix=/usr/local/services/php-5.4.39/plugins/jpeg-7
ログイン後にコピー
tar zxf gd-2.0.35.tar.gzcd gd-2.0.35 ./configure \ --prefix=/usr/local/services/php-5.4.39/plugins/gd-2.0.35 \ --with-freetype=/usr/local/services/php-5.4.39/plugins/freetype-2.4.10 \ --with-png=/usr/local/services/php-5.4.39/plugins/libpng-1.5.12 \ --with-jpeg=/usr/local/services/php-5.4.39/plugins/jpeg-7
ログイン後にコピー
" >
tar zxf gd-2.0.35.tar.gzcd gd-2.0.35 ./configure \ --prefix=/usr/local/services/php-5.4.39/plugins/gd-2.0.35 \ --with-freetype=/usr/local/services/php-5.4.39/plugins/freetype-2.4.10 \ --with-png=/usr/local/services/php-5.4.39/plugins/libpng-1.5.12 \ --with-jpeg=/usr/local/services/php-5.4.39/plugins/jpeg-7
ログイン後にコピー
3. Apache httpd を設定します。 php ファイルをサポートするための .conf解析
ホームページ バックエンド開発 PHPチュートリアル ランプのインストール (CentOS6.6、php-5.4.39、httpd-2.4.12、mysql-5.6.24)

ランプのインストール (CentOS6.6、php-5.4.39、httpd-2.4.12、mysql-5.6.24)

Jun 23, 2016 pm 01:36 PM

ソフトウェア バージョン:

pcre-8.36.tar.gz
apr-1.5.1.tar.gz
apr-util-1.5.4.tar.gz
httpd-2.4.12.tar.bz2

mysql-5.6。 24.tar.gz

libxml2-2.7.8.tar.gz
libpng-1.5.12.tar.gz
freetype-2.4.10.tar.gz
jpegsrc.v7.tar.gz
gd-2.0.35 .tar.gz
php-5.4.39.tar.gz

Baidu クラウドのダウンロード アドレス: http://pan.baidu.com/s/1dDGT9KH

手順の概要:

1、apache

2、mysql

3、php

4、検証

備考:

すべての操作 (指定なし) は、オペレーティング ディレクトリとして /usr/local/src に基づいており、すべてのソフトウェア パッケージはこのディレクトリにあります。

具体的な手順:

apache をインストールする

ソフトウェア パッケージの依存関係: pcre、apr、apr-util

1. インストールを進める (インストール ディレクトリ、将来 httpd がインストールされるディレクトリ (/usr/local/services/) httpd-2.4.12/) をベンチマークとして使用し、同じモデルのマシンへの将来の移植を容易にするために、プラグイン ディレクトリにインストールします。 apr、apr-util には、Apache のインストールに特定の操作手順があります。次のようにドキュメントを作成します

tar zxf pcre-8.36.tar.gzcd pcre-8.36 ./configure --prefix=/usr/local/services/httpd-2.4.12/plugins/pcre-8.36 make make install
ログイン後にコピー

3. Apache をインストールします

tar zxf apr-1.5.1.tar.gz -C ./httpd-2.4.12/srclib/tar zxf apr-util-1.5.4.tar.gz -C ./httpd-2.4.12/srclib/cd httpd-2.4.12/srclib/ln -s apr-util-1.5.4/ apr-util ln -s apr-1.5.1 apr
ログイン後にコピー

mysql

をインストールします

準備条件: cmake、ncurses-devel、bison、直接インストールされていない場合は、yum install xxx

tar zxf httpd-2.4.12.tar.gzcd httpd-2.4.12 ./configure \ --prefix=/usr/local/services/httpd-2.4.12 \ --with-pcre=/usr/local/services/httpd-2.4.12/plugins/pcre-8.36 \ --with-included-apr \ --enable-rewrite=shared \ --enable-somakemake install
ログイン後にコピー

注意:

インストール完了後に初めてログインすると、セグメンテーション違反が発生します

これはバグです: https://bugs.launchpad.net/percona-server/+bug/1201123

解決策:

1.パッケージ、ファイル cmd-line-utils/libedit/terminal.c を編集し、コード セグメント (行 869) を見つけて char buf[TC_BUFSIZE] をコメント化し、次の変数 (行 879) を見つけて変更します。 to area = NULL;

2. 再コンパイルするだけ

phpをインストールする
3つのステップに分かれています

1、libxml2

2、gd2

3、php

libxml2をインストールする

tar zxf mysql-5.6.24.tar.gzcd mysql-5.6.24 cmake \ -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/services/mysql-5.6.24 \ -DMYSQL_DATADIR:PATH=/data/mysql \ -DEXTRA_CHARSETS=all \ -DENABLED_LOCAL_INFILE=1 \ -DWITH_READLINE=1 \ -DMYSQL_USER=mysql \ -DENABLED_LOCAL_INFILE=1 \ -DWITH_SSL=yes make make install #添加软连接 ln -s /usr/local/services/mysql-5.6.24/ mysql #添加PATH echo "PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile source /etc/profile #修改目录权限 mkdir -p /data/mysql chown -R mysql:mysql /usr/local/mysql chown -R mysql:mysql /data/mysql #拷贝配置文件 cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf # 添加用户 groupadd mysql useradd -g mysql mysql #设置my.conf 在[mysqld]中设置 datadir=/data/mysql #初始化 /usr/local/mysql/scripts/mysql_install_db --user=mysql --datadir=/data/mysql --basedir=/usr/local/mysql #设置mysql服务 cp /usr/local/mysql/support-files/mysql.server /etc/rc.d/init.d/mysqld chkconfig --add mysqld service mysql start #空密码登陆mysql mysql #mysql 设置权限,同一个用户在不同机器上的密码可能不同。 grant all privileges on *.* to root@'localhost' identified by '123456'; grant all privileges on *.* to root@'%' identified by '123456'; # root密码登陆 mysql -uroot -p123456
ログイン後にコピー

gd をインストールします

含まれるもの: libpng、freetype、jpeg、gd

libpng

をインストールする

tar zxf libxml2-2.7.8.tar.gzcd libxml2-2.7.8 ./configure \ --prefix=/usr/local/services/php-5.4.39/plugins/libxml2-2.7.8
ログイン後にコピー

freetypeをインストールする

tar zxf libpng-1.5.12.tar.gzcd libpng-1.5.12 ./configure \ --prefix=/usr/local/services/php-5.4.39/plugins/libpng-1.5.12
ログイン後にコピー

jpegをインストールする

gd をインストールする

tar zxf freetype-2.4.10.tar.gz cd freetype-2.4.10 ./configure \ --prefix=/usr/local/services/php-5.4.39/plugins/freetype-2.4.10
ログイン後にコピー

php をインストールする

tar zxf jpegsrc.v7.tar.gz cd jpeg-7 ./configure \ --prefix=/usr/local/services/php-5.4.39/plugins/jpeg-7
ログイン後にコピー

コンパイルでエラーが発生しました:

tar zxf gd-2.0.35.tar.gzcd gd-2.0.35 ./configure \ --prefix=/usr/local/services/php-5.4.39/plugins/gd-2.0.35 \ --with-freetype=/usr/local/services/php-5.4.39/plugins/freetype-2.4.10 \ --with-png=/usr/local/services/php-5.4.39/plugins/libpng-1.5.12 \ --with-jpeg=/usr/local/services/php-5.4.39/plugins/jpeg-7
ログイン後にコピー

解決策 (Google 後、バグ: https://bugs.php.net/bug.php?id=55224):

./configure \--prefix=/usr/local/services/php-5.4.39 \ --with-mysql=/usr/local/services/mysql-5.6.24 \ --with-mysqli=/usr/local/services/mysql-5.6.24/bin/mysql_config \ --with-apxs2=/usr/local/services/httpd-2.4.12/bin/apxs \ --with-libxml-dir=/usr/local/services/php-5.4.39/plugins/libxml2-2.7.8 \ --with-gd=/usr/local/services/php-5.4.39/plugins/gd-2.0.35 \ --with-freetype-dir=/usr/local/services/php-5.4.39/plugins/freetype-2.4.10 \ --with-png-dir=/usr/local/services/php-5.4.39/plugins/libpng-1.5.12 \ --with-jpeg-dir=/usr/local/services/php-5.4.39/plugins/jpeg-7 \ --enable-mbstring \ --enable-maintainer-zts \ --enable-sockets \ --enable-pcntl \ --enable-sysvmsg \ --enable-sysvsem \ --enable-sysvshm \ --enable-soap \ --enable-shmop \ --enable-bcmath \ --enable-zip \ --enable-calendar \ --enable-ctype \ --enable-dom \ --enable-filter \ --enable-gd-native-ttf \ --enable-hash \ --enable-json \ --enable-posix \ --enable-shared \ --enable-simplexml \ --enable-static \ --enable-tokenizer \ --enable-xml \ --enable-xmlwriter \ --enable-pdo \ --enable-inline-optimization \ --enable-mysqlnd \ --enable-exif \ --enable-sigchild \ --enable-fpmmakemake install
ログイン後にコピー

再コンパイル、コンパイルは成功しました

設定とテスト

1. ソフト接続を作成し、PATH を追加します

2. php.ini を設定します

3. Apache httpd を設定します。 php ファイルをサポートするための .conf解析

In file included from /kk/php-5.4.0/ext/gd/gd.c:103:/kk/php-5.4.0/ext/gd/gd_ctx.c: In function ‘_php_image_stream_putc’:
ログイン後にコピー

4. ビルドファイルテスト

vim /usr/local/services/php-5.4.39/plugins/gd-2.0.35/include/gd_io.h中(14行) typedef struct gdIOCtx  结构体中添加:void (*data); 修改后如下: typedef struct gdIOCtx { int (*getC) (struct gdIOCtx *); int (*getBuf) (struct gdIOCtx *, void *, int); void (*putC) (struct gdIOCtx *, int); int (*putBuf) (struct gdIOCtx *, const void *, int); /* seek must return 1 on SUCCESS, 0 on FAILURE. Unlike fseek! */ int (*seek) (struct gdIOCtx *, const int); long (*tell) (struct gdIOCtx *); void (*gd_free) (struct gdIOCtx *); void (*data); }
ログイン後にコピー

5. Apache を再起動します

ln -s /usr/local/services/php-5.4.39 phpln -s /usr/local/services/httpd-2.4.12 apache ln -s /usr/local/services/mysql-5.6.24 mysql echo "PATH=$PATH:/usr/local/php/bin:/usr/local/mysql/bin" >> /etc/profile source profile
ログイン後にコピー

ブラウザアクセス: http://127.0.0.1/phpinfo.php

以下のように表示されます:

このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。

ホットAIツール

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

AI Hentai Generator

AI Hentai Generator

AIヘンタイを無料で生成します。

ホットツール

メモ帳++7.3.1

メモ帳++7.3.1

使いやすく無料のコードエディター

SublimeText3 中国語版

SublimeText3 中国語版

中国語版、とても使いやすい

ゼンドスタジオ 13.0.1

ゼンドスタジオ 13.0.1

強力な PHP 統合開発環境

ドリームウィーバー CS6

ドリームウィーバー CS6

ビジュアル Web 開発ツール

SublimeText3 Mac版

SublimeText3 Mac版

神レベルのコード編集ソフト(SublimeText3)

Laravelでフラッシュセッションデータを使用します Laravelでフラッシュセッションデータを使用します Mar 12, 2025 pm 05:08 PM

Laravelは、直感的なフラッシュメソッドを使用して、一時的なセッションデータの処理を簡素化します。これは、アプリケーション内に簡単なメッセージ、アラート、または通知を表示するのに最適です。 データは、デフォルトで次の要求のためにのみ持続します。 $リクエスト -

PHPのカール:REST APIでPHPカール拡張機能を使用する方法 PHPのカール:REST APIでPHPカール拡張機能を使用する方法 Mar 14, 2025 am 11:42 AM

PHPクライアントURL(CURL)拡張機能は、開発者にとって強力なツールであり、リモートサーバーやREST APIとのシームレスな対話を可能にします。尊敬されるマルチプロトコルファイル転送ライブラリであるLibcurlを活用することにより、PHP Curlは効率的なexecuを促進します

Laravelテストでの簡略化されたHTTP応答のモッキング Laravelテストでの簡略化されたHTTP応答のモッキング Mar 12, 2025 pm 05:09 PM

Laravelは簡潔なHTTP応答シミュレーション構文を提供し、HTTP相互作用テストを簡素化します。このアプローチは、テストシミュレーションをより直感的にしながら、コード冗長性を大幅に削減します。 基本的な実装は、さまざまな応答タイプのショートカットを提供します。 Illuminate \ support \ facades \ httpを使用します。 http :: fake([[ 'google.com' => 'hello world'、 'github.com' => ['foo' => 'bar']、 'forge.laravel.com' =>

Codecanyonで12の最高のPHPチャットスクリプト Codecanyonで12の最高のPHPチャットスクリプト Mar 13, 2025 pm 12:08 PM

顧客の最も差し迫った問題にリアルタイムでインスタントソリューションを提供したいですか? ライブチャットを使用すると、顧客とのリアルタイムな会話を行い、すぐに問題を解決できます。それはあなたがあなたのカスタムにより速いサービスを提供することを可能にします

PHPにおける後期静的結合の概念を説明します。 PHPにおける後期静的結合の概念を説明します。 Mar 21, 2025 pm 01:33 PM

記事では、PHP 5.3で導入されたPHPの後期静的結合(LSB)について説明し、より柔軟な継承を求める静的メソッドコールのランタイム解像度を可能にします。 LSBの実用的なアプリケーションと潜在的なパフォーマ

フレームワークのカスタマイズ/拡張:カスタム機能を追加する方法。 フレームワークのカスタマイズ/拡張:カスタム機能を追加する方法。 Mar 28, 2025 pm 05:12 PM

この記事では、フレームワークにカスタム機能を追加し、アーキテクチャの理解、拡張ポイントの識別、統合とデバッグのベストプラクティスに焦点を当てています。

フレームワークセキュリティ機能:脆弱性から保護します。 フレームワークセキュリティ機能:脆弱性から保護します。 Mar 28, 2025 pm 05:11 PM

記事では、入力検証、認証、定期的な更新など、脆弱性から保護するためのフレームワークの重要なセキュリティ機能について説明します。

See all articles