Skip to content

Commit 43613d9

Browse files
authored
Merge pull request phpredis#1316 from remicollet/issue-inst
split INSTALL and add more instructions
2 parents 18d03fd + e99e69c commit 43613d9

File tree

3 files changed

+97
-47
lines changed

3 files changed

+97
-47
lines changed

INSTALL.markdown

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Installation from pecl
2+
3+
To pull latest stable released version, from [pecl](https://pecl.php.net/package/redis):
4+
5+
~~~
6+
pecl install redis
7+
~~~
8+
9+
# Installation from sources
10+
11+
To build this extension for the sources tree:
12+
13+
~~~
14+
phpize
15+
./configure [--enable-redis-igbinary]
16+
make && make install
17+
~~~
18+
19+
If you would like phpredis to serialize your data using the igbinary library, run configure with `--enable-redis-igbinary`.
20+
`make install` copies `redis.so` to an appropriate location, but you still need to enable the module in the PHP config file. To do so, either edit your php.ini or add a redis.ini file in `/etc/php5/conf.d` with the following contents: `extension=redis.so`.
21+
22+
You can generate a debian package for PHP5, accessible from Apache 2 by running `./mkdeb-apache2.sh` or with `dpkg-buildpackage` or `svn-buildpackage`.
23+
24+
This extension exports a single class, [Redis](#class-redis) (and [RedisException](#class-redisexception) used in case of errors). Check out https://github.com/ukko/phpredis-phpdoc for a PHP stub that you can use in your IDE for code completion.
25+
26+
27+
# Binary packages
28+
29+
Most distributions provides pre-build binary packages of this extension.
30+
31+
## Windows:
32+
33+
Follow the DLL link on the [https://pecl.php.net/package/redis](https://pecl.php.net/package/redis) page.
34+
35+
## Fedora
36+
37+
Fedora users can install the package from the official repositor.
38+
39+
**Fedora ≤ 28, Version 3 **
40+
41+
Installation of the [php-pecl-redis](https://apps.fedoraproject.org/packages/php-pecl-redis) package:
42+
43+
~~~
44+
dnf install php-pecl-redis
45+
~~~
46+
47+
**Fedora ≥ 27, Version 4 **
48+
49+
Installation of the [php-pecl-redis4](https://apps.fedoraproject.org/packages/php-pecl-redis4) package:
50+
51+
~~~
52+
dnf install php-pecl-redis4
53+
~~~
54+
55+
## RHEL / CentOS
56+
57+
Installation of the [php-pecl-redis](https://apps.fedoraproject.org/packages/php-pecl-redis) package, from the [EPEL repository](https://fedoraproject.org/wiki/EPEL):
58+
59+
~~~
60+
yum install php-pecl-redis
61+
~~~
62+
63+
64+
# Installation on OSX
65+
66+
If the install fails on OSX, type the following commands in your shell before trying again:
67+
~~~
68+
MACOSX_DEPLOYMENT_TARGET=10.6
69+
CFLAGS="-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp"
70+
CCFLAGS="-arch i386 -arch x86_64 -g -Os -pipe"
71+
CXXFLAGS="-arch i386 -arch x86_64 -g -Os -pipe"
72+
LDFLAGS="-arch i386 -arch x86_64 -bind_at_load"
73+
export CFLAGS CXXFLAGS LDFLAGS CCFLAGS MACOSX_DEPLOYMENT_TARGET
74+
~~~
75+
76+
If that still fails and you are running Zend Server CE, try this right before "make": `./configure CFLAGS="-arch i386"`.
77+
78+
Taken from [Compiling phpredis on Zend Server CE/OSX ](http://www.tumblr.com/tagged/phpredis).
79+
80+
See also: [Install Redis & PHP Extension PHPRedis with Macports](http://www.lecloud.net/post/3378834922/install-redis-php-extension-phpredis-with-macports).
81+
82+
You can install it using Homebrew:
83+
84+
- [Get homebrew-php](https://github.com/Homebrew/homebrew-php)
85+
- `brew install php55-redis` (or php53-redis, php54-redis)
86+
87+
# Building on Windows
88+
89+
See [instructions from @char101](https://github.com/phpredis/phpredis/issues/213#issuecomment-11361242) on how to build phpredis on Windows.
90+

README.markdown

Lines changed: 6 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -34,49 +34,13 @@ You can send comments, patches, questions [here on github](https://github.com/ph
3434

3535
-----
3636

37-
# Installing/Configuring
37+
# Installation
3838
-----
3939

40-
Everything you should need to install PhpRedis on your system.
40+
For everything you should need to install PhpRedis on your system,
41+
see the [INSTALL.markdown](./INSTALL.markdown) page.
4142

42-
## Installation
43-
44-
~~~
45-
phpize
46-
./configure [--enable-redis-igbinary]
47-
make && make install
48-
~~~
49-
50-
If you would like phpredis to serialize your data using the igbinary library, run configure with `--enable-redis-igbinary`.
51-
`make install` copies `redis.so` to an appropriate location, but you still need to enable the module in the PHP config file. To do so, either edit your php.ini or add a redis.ini file in `/etc/php5/conf.d` with the following contents: `extension=redis.so`.
52-
53-
You can generate a debian package for PHP5, accessible from Apache 2 by running `./mkdeb-apache2.sh` or with `dpkg-buildpackage` or `svn-buildpackage`.
54-
55-
This extension exports a single class, [Redis](#class-redis) (and [RedisException](#class-redisexception) used in case of errors). Check out https://github.com/ukko/phpredis-phpdoc for a PHP stub that you can use in your IDE for code completion.
56-
57-
58-
## Installation on OSX
59-
60-
If the install fails on OSX, type the following commands in your shell before trying again:
61-
~~~
62-
MACOSX_DEPLOYMENT_TARGET=10.6
63-
CFLAGS="-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp"
64-
CCFLAGS="-arch i386 -arch x86_64 -g -Os -pipe"
65-
CXXFLAGS="-arch i386 -arch x86_64 -g -Os -pipe"
66-
LDFLAGS="-arch i386 -arch x86_64 -bind_at_load"
67-
export CFLAGS CXXFLAGS LDFLAGS CCFLAGS MACOSX_DEPLOYMENT_TARGET
68-
~~~
69-
70-
If that still fails and you are running Zend Server CE, try this right before "make": `./configure CFLAGS="-arch i386"`.
71-
72-
Taken from [Compiling phpredis on Zend Server CE/OSX ](http://www.tumblr.com/tagged/phpredis).
73-
74-
See also: [Install Redis & PHP Extension PHPRedis with Macports](http://www.lecloud.net/post/3378834922/install-redis-php-extension-phpredis-with-macports).
75-
76-
You can install it using Homebrew:
77-
78-
- [Get homebrew-php](https://github.com/Homebrew/homebrew-php)
79-
- `brew install php55-redis` (or php53-redis, php54-redis)
43+
# Configuration
8044

8145
## PHP Session handler
8246

@@ -100,18 +64,13 @@ The session handler requires a version of Redis with the `SETEX` command (at lea
10064
phpredis can also connect to a unix domain socket: `session.save_path = "unix:///var/run/redis/redis.sock?persistent=1&weight=1&database=0`.
10165

10266

103-
## Building on Windows
104-
105-
See [instructions from @char101](https://github.com/phpredis/phpredis/issues/213#issuecomment-11361242) on how to build phpredis on Windows.
106-
107-
10867
## Distributed Redis Array
10968

110-
See [dedicated page](https://github.com/phpredis/phpredis/blob/master/arrays.markdown#readme).
69+
See [dedicated page](./arrays.markdown#readme).
11170

11271
## Redis Cluster support
11372

114-
See [dedicated page](https://github.com/phpredis/phpredis/blob/develop/cluster.markdown#readme).
73+
See [dedicated page](./cluster.markdown#readme).
11574

11675
## Running the unit tests
11776

package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
6565
<file role='doc' name='COPYING'/>
6666
<file role='doc' name='CREDITS'/>
6767
<file role='doc' name='README.markdown'/>
68+
<file role='src' name='INSTALL.markdown'/>
6869
<file role='doc' name='arrays.markdown'/>
6970
<file role='doc' name='cluster.markdown'/>
7071
<file role='src' name='cluster_library.c'/>

0 commit comments

Comments
 (0)