Skip to content

Instantly share code, notes, and snippets.

@richp10
Created August 24, 2015 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richp10/464e363a321c7238fbd3 to your computer and use it in GitHub Desktop.
Save richp10/464e363a321c7238fbd3 to your computer and use it in GitHub Desktop.
PHP phpdaemon dependencies
#!/bin/bash
export CHOST="x86_64-pc-linux-gnu"
export CFLAGS="-march=native -O3 -pipe -Wall -D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=native"
export CXXFLAGS="${CFLAGS}"
__prep() {
yum -y remove libevent
yum -y install gcc cmake openssl-devel
}
__libevent() {
# Need this additional flag - put here so we don't forget..
CFLAGS="-fPIC "$CFLAGS
mkdir -p /src && cd src
git clone https://github.com/libevent/libevent.git
cd libevent
mkdir build && cd build
cmake .. # Default to Unix Makefiles.
make depend
make
make install
}
__pecl() {
printf "\n" | pecl install eio
printf "\n" | pecl install channel://pecl.php.net/proctitle-0.1.2
printf "\n" | pecl install inotify
echo "extension=eio.so" >> /etc/php.ini
echo "extension=inotify.so" >> /etc/php.ini
echo "extension=proctitle.so" >> /etc/php.ini
echo "extension=event.so" >> /etc/php.ini
}
__event() {
cd /src
git clone -q https://osmanov:test@bitbucket.org/osmanov/pecl-event
cd pecl-event
phpize
./configure --with-event-core --with-event-extra --with-event-openssl=no --with-event-libevent-dir=/usr/local/include/event2/
make
make install
}
__misc() {
mkdir /opt/php
chown -R php:php /opt/php
}
__prep
__libevent
__pecl
__event
__misc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment