PHP

PHP Script for SVN update With below PHP script you can update SVN from browser. <?php echo shell_exec(‘/usr/bin/svn cleanup /var/www/html/sunil –non-interactive –username sunil –password sun123 –config-dir /home/sunil/.subversion’);  echo shell_exec(‘/usr/bin/svn update 2>&1 /var/www/html/sunil –non-interactive –username sunil –password sun123 –config-dir /home/sunil/.subversion’); ?>   Replace web directory path …

Run/Include php code in .shtml   To run php code in .shtml add below Apache directive’s either in .htaccess .   # vi .htaccess AddType text/html .shtml AddHandler server-parsed .shtml AddType application/x-httpd-php .shtml RemoveHandler .shtml .html .htm Options Indexes FollowSymLinks Includes XBitHack on DirectoryIndex index.shtml …

 Restrict drupal admin section to open with website/domain   To restrict drupal admin for public network we have to take help mod rewrite module. By this way we can apply restriction. Simply we have to write mod rewrite rule <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_HOST} …

ERROR:  Invalid command ‘SecRuleEngine’, perhaps misspelled or defined by a module not included in the server configuration[solved]                When you installed mod_security with Apache while restarting Apache, it won’t restart. It goes down due to Apache misconfiguration. Solution: You installed/compiled mod-security and add modsecurity.conf …

ERROR: configure: error: pcre library is required While installing mod-security in Apache you might stop at the time of source code configuration. You might get below error. configure: error: pcre library is required Don’t be afraid here is solution. Install PCRE-DEVEL package to fix this …

Pecl  is not working behind proxy [Solved]   If you are trying to upgrade pecl packages and you are getting forbidden error. Set proxy with pecl config. $pecl upgrade-all Error getting channel info from pear.php.net: File http://pear.php.net:80/rest/p/packages.xml not valid (received: HTTP/1.0 403 Forbidden) Error getting …

You can enable/set up cache validator from .htaccess.  Insert below code in your .htaccess file and restart Apache server.   ========================================= <IfModule mod_expires.c> ExpiresActive on # Perhaps better to whitelist expires rules? Perhaps. ExpiresDefault                          “access plus 1 year” # cache.appcache needs re-requests in FF 3.6 …

Install FFMPEG and FFMPEG-PHP On CentOs & RedHat   We can install ffmpeg with yum repository but before we have to create new repo with name dag.repo   Create new repository with name dag.repo #vi /etc/yum.repos.d/dag.repo Add DAG GPG key   Update yum # yum …

Installing PHP on CentOs and RedHat 1) Installing PHP with yum: #yum -y install php *  2) Check with below command php and and it’s extension’s are installed proeperly: Command:  #rpm -qa|grep php   3)  Test PHP with Apache: Default Document Root for Apache is …