Tikejhya: Ashish Nepal

Knowledgebase

Category: PHP

kernel: php-cgi[7094]: segfault at

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

Apr 23 17:50:12 web1 kernel: php-cgi[7094]: segfault at ffffffffffffffff ip 00007f27b67e67b8 sp 00007ffff22d8f28 error 6 in libpthread-2.12.so[7f27b67dc000+17000]

Solution:

This is permision issue.
[probably check ur php.ini path for apc or things like that]

kernel: php-cgi[7094]: segfault at in libpthread-2.12.so

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

Apr 23 17:50:12 web-server kernel: php-cgi[7094]: segfault at ffffffffffffffff ip 00007f27b67e67b8 sp 00007ffff22d8f28 error 6 in libpthread-2.12.so[7f27b67dc000+17000]

Solution:
This is probably permission issue.

Upgrade php Script

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

#!/bin/bash

#######################################################################
# This script upgrades php into newer version with simply passing     #
# version as an argument i.e. sh upgrade_php.sh PHP-5.3.17 (if        #
# i want to upgrade to given version.)                                #
#                                                                     #
# This script usage repo of uk.php.net which might not work if there  #
# is change with layout of repository, you might simply want to change#
# URL on REPO on line 35                                              #
#                                                                     #
# NOTE: So far this script only identifies HTTPD/LIGHTTPD, which      #
# has to be changed according to your need on line 45 (i.e. grep )    #
#######################################################################

function chkInput
                {
                if [ -z "$1" ];then
                displayUsage
                exit 0;
                fi
                }

function displayUsage
                {
                echo "Please enter php version you want to upgrade for"
                echo "If you want to upgrade php version 5.3.17 please write PHP-5.3.17"
                echo "Usage: sh upgrade_php.sh PHP-5.x.x"
                }



chkInput $1

REPO=`echo http://uk.php.net/get/$1.tar.gz/from/this/mirror | sed -e's/PHP/php/g'`


CUR_VERSION=`php --version | head -1 | cut -d' ' -f1,2 | sed -e 's/PHP /php-/g'`
CONFIGURE=`php -i | grep -i configure | awk '{for (i=1; i<=NF-3; i++) $i = $(i+3); NF-=3; print}'`
TARFILE=`echo $REPO | cut -d"/" -f5`
VERSION=`echo $REPO | cut -d"/" -f5 | sed -e's/.......$//g'`
SRC="/usr/local/src"
LOCALREPO="/usr/local/src/$VERSION/"

WEBSERVER=`netstat -tupan | grep -i 80 | grep -i "httpd" | awk '{ print $7}' | cut -d'/' -f2 | sort | uniq`




         if [ "$CUR_VERSION" = "$VERSION" ]; then
         echo 'Old Version: '$CUR_VERSION' Is same as Target Version: '$VERSION''


         else
                echo " Preparing PHP Upgrade from $CUR_VERSION to $VERSION "

                        read -t 5 -p "Press 'Q' to abort within 5 seconds..:" confirm

                                if [ "$confirm" != 'Q' ];then

                                                `cd $SRC && wget $REPO && tar -zxvf $TARFILE && cd $VERSION && $CONFIGURE && make && make install && service $WEBSERVER restart`

                                else
                                                echo "User Abort,exiting..."
                                fi
        fi

###### Standard PHP Config

./configure  --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php5 --with-apxs2 --with-openssl --with-kerberos --with-zlib --with-bz2 --enable-calendar --with-curl --enable-dba --with-db4 --with-gdbm --enable-ftp --with-gd --with-jpeg-dir=/usr/lib64 --with-png-dir=/usr/lib64 --enable-gd-native-ttf --with-gettext --with-mhash --with-imap --with-imap-ssl --with-ldap --with-ldap-sasl --enable-mbstring --with-mcrypt --with-mysql --enable-soap --enable-sockets --enable-sqlite-utf8 --enable-zip --with-libdir=lib64 --with-iconv --with-xmlrpc --with-mime-magic --enable-pdo --with-gd-ttf --with-freetype-dir=/usr/include/freetype2/ --enable-intl --enable-bcmath

How to check modules compiled with php on your server

How to check modules compiled with php on your server

php -i | grep -i configure | awk '{for (i=1; i<=NF-3; i++) $i = $(i+3); NF-=3; print}'

Log analyzer

How to view .gz formated log files.
Log analyzer, log viewer,

This code helps you to view log files from, server using web server, within .gz format or, .gz.%s (date formated).

'.$entry.'';
                        }
}



function zcat($filename,$cmd="")
{


        $cmd = $cmd ? "zcat $filename | $cmd" : "zcat $filename";
        echo "CMD:$cmd";
        $filename=htmlentities($filename);
        echo "Filename:$filename";
    //$output = $cmd ? shell_exec("zcat $filename | $cmd"): shell_exec("zcat $filename");
        $output = shell_exec($cmd);
        //$output=shell_exec("zcat $filename");
        echo "Before replace:$output";
        $output = str_replace("n", "
", $output); echo "After Replace:$output"; return $output ? $output : "No Data Found"; } function execute($cmd) { shell_exec("$cmd"); } //function to display the command box function displayCmdBox($filename) { ?>

Apache Auto Index

To enable index.php (auto)

LoadModule autoindex_module modules/mod_autoindex.so
DirectoryIndex index.php

Enable Zend or IonCube

Where?
php.ini

Enable Zend Extension In PHP

zend_extension=/home/ashishnepal/ZendOptimizer-3.3.9-linux-glibc23-x86_64/data/5_1_x_comp/ZendOptimizer.so

ioncube_loader_lin_5.3_ts.so

zend_extension = /home/ashishnepal/ioncube/ioncube_loader_lin_5.3.so

** Installing to a remote UNIX/LINUX DEDICATED or VPS server

1. Upload the contents of this package to /usr/local/ioncube

2. Copy the loader-wizard.php script to the root web directory of a
configured domain on the server

2. Launch the Loader Wizard script in your browser. For example:
http://yourdomain/loader-wizard.php

redirect http to https

This is tips to redirect http://www.example.com to https://www.example.com

vi httpd.conf

Create a Virtualhost for

http://www.example.com/

“in the given location create index.php which looks like”

Convert Date timestamp

`date +’%Y-%m-%d%H:%M:%S’`

PHP – Time stamp (weekly time stamp)

Powered by WordPress & Theme by Anders Norén