Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Change to PATH-TO-THRIFT/lib/php/src/ext/thrift_protocol.
  2. Install support for building PHP extensions:
    • On Ubuntu:
      No Format
      sudo apt-get install php5-dev
      
    • On CentOS:
      No Format
      sudo yum install php-devel
      
  3. Build the extension:
    No Format
    phpize
    ./configure --enable-thrift_protocol
    make
    
  4. Copy the extension's .so to the extensions directory.
    • On Ubuntu:
      No Format
      sudo cp modules/thrift_protocol.so /usr/lib/php5/20060613/
      
    • On 64-bit CentOS:
      No Format
      sudo cp modules/thrift_protocol.so /usr/lib64/php/modules/
      
  5. Enable the module.
    • On Ubuntu:
      Code Block
      titlesudo nano /etc/php5/conf.d/thrift_protocol.ini
      extension=thrift_protocol.so
      
    • On CentOS:
      Code Block
      titlesudo nano /etc/php.d/thrift_protocol.ini
      extension=thrift_protocol.so
      
  6. Verify installation:
    No Format
    php -i | grep -v "PWD" | grep "thrift_protocol"
    
  7. Restart Apache.
    • On Ubuntu:
      No Format
      sudo /etc/init.d/apache2 restart
      
    • On CentOS:
      No Format
      sudo /etc/init.d/httpd restart
      
  8. Ensure that the PHP is using TBinaryProtocolAccelerated and not TBinaryProtocol as the protocol.

...