PhalconPHP

Installation

Clone this repository into /var/cpanel/easy/apache/custom_opt_mods/ like so:


# cd /var/cpanel/easy/apache/custom_opt_mods/
# git clone https://github.com/thecpaneladmin/EA-PhalconPHP.git .
# /scripts/easyapache

Git on cpanel is at

# /usr/local/cpanel/3rdparty/bin/git

Or use the .zip:


# cd /usr/src
# wget https://github.com/thecpaneladmin/EA-PhalconPHP/archive/master.zip
# unzip -d /var/cpanel/easy/apache/custom_opt_mods/ master.zip
# /scripts/easyapache

Make sure that the path is


/var/cpanel/easy/apache/custom_opt_mods]# ls -la

drwxr-xr-x 4 root root  4096 Sep  2 20:26 ./
drwxr-xr-x 9 root root  4096 Sep  2 20:38 ../
drwxr-xr-x 3 root root  4096 Sep  2 20:26 Cpanel/
-rw-r--r-- 1 root root   606 Sep  2 20:32 error_log
drwxr-xr-x 7 root root  4096 Sep  2 20:26 .git/
-rw-r--r-- 1 root root 18025 Sep  2 20:26 LICENSE
-rw-r--r-- 1 root root   834 Sep  2 20:26 README.md

Or it will not show up in easy apache.

From here, select Phalcon from the list of PHP modules. The module will be loaded from /usr/local/lib/php.ini.

White Screen of Death (WSOD) in php page

You must turn on PHP error reporting. To do this, you should change the setting in your php.ini config file. Temporarily insert the following lines in your index.php file:


error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

Make sure that you have inserted the code directly after the opening PHP tag. The errors should now appear directly on your screen. Alternatively, check your log files for the most recent errors.

Categories PHP

Imagemagick on CentOS and Plesk

root@server ~]# yum install ImageMagick
[root@server ~]# yum install ImageMagick-devel

PHP-imagick Installation:
[root@server ~]# yum install gcc
[root@server ~]# yum install make automake
[root@server ~]# yum install php-pear
[root@server ~]# yum install php-devel
[root@server ~]# pecl install imagick

On some servers

yum install php-pecl-imagick.x86_64

Test:

convert image.jpg -resize 64x64 resize_image.jpg

Cannot find mail.php

For WHM

You should be able to enable this in the WHM section – Home » Software » Module Installers. Click “Manage” PHP Extensions and Applications Package. Search for Find a PHP Extensions and Applications Package – Mail. You should be able to instal this there.

Categories PHP

How to check whether mod_rewrite is enable on server?

Usually cpanel(WHM) compiles mod_rewrite by default. You can check with this:


root@server [~]# httpd -l|grep rewrite

So you must just activate it in your ‘.htaccess’ using:


RewriteEngine On

To check if mod_rewrite module is enabaled, create a new php file in your root folder of your WAMP server. Enter the following

phpinfo();

Access your created file from your browser.

Ctrl+F to open a search. Search for ‘mod_rewrite’. If it is enabled you see it as ‘Loaded Modules’

If not, open httpd.conf (Apache Config file) and look for the following line.


#LoadModule rewrite_module modules/mod_rewrite.so

remove the pound (‘#’) sign at the start and save the this file.

Restart your apache server.

Access the same php file in your browser.

search for ‘mod_rewrite’ again. You should be able to find it now.

For Plesk Servers

Log into your server via ssh as root.

Mod Rewrite is enabled by default on plesk servers. You can verify this with the following command:

 
# apachectl -M | grep rewrite

modify the vhost.conf file at /var/www/vhosts/example.com/conf/vhost.conf

 
# replace "AllowOverride None" with "AllowOverride all".

restart apache with the following command:


service httpd restart
 

Create a .htaccess containing the following and upload it to the root of your site:

 
RewriteEngine On
RewriteRule ^google.html$ http://www.google.com/ [R=301]

Going to http://www.yoursite.com/google.html should redirect you to Google.com if you have mod rewrite enabled and your syntax is correct.

For more information on Mod rewrite see the following links.

http://httpd.apache.org/docs/current/mod/mod_rewrite.html
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

Categories PHP

Is a module installed in php?

Try this

]# php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
intl
json
ldap
libxml
mbstring
mcrypt
mhash
mysql
mysqli
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
pspell
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
zip
zlib

If you do not see the module – then you need to install it.

Categories PHP

Opencart View Order Error

Viewing the orders in opencart admin – the following errors appear:


[Wed Apr 01 14:51:21 2015] [warn] [client 67.81.xxx.xx] mod_fcgid: read data timeout in 45 seconds, referer: https://www.domainname.com/admin/index.php?route=sale/order&token=96d6680034320729c7df84d678589324

Try to increase the timeout in the /etc/httpd/conf.d/fcgid.conf file to 90 seconds.

Downgrade php from 5.4 to 5.3 after atomic upgrade

Disable Atomic


[root@dedicated yum.repos.d]# nano atomic.repo

# Name: Atomic Rocket Turtle RPM Repository for CentOS / Red Hat Enterprise Linux 6 -
# URL: http://www.atomicrocketturtle.com/
# Note: This isn't covered by ASL support. -Scott
[atomic]
name = CentOS / Red Hat Enterprise Linux $releasever - atomicrocketturtle.com
mirrorlist = http://updates.atomicorp.com/channels/mirrorlist/atomic/centos-$releasever-$basearch
enabled = 0
priority = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt
        file:///etc/pki/rpm-gpg/RPM-GPG-KEY.atomicorp.txt
gpgcheck = 1

# Almost Stable, release candidates for [atomic]
[atomic-testing]
name = CentOS / Red Hat Enterprise Linux $releasever - atomicrocketturtle.com - (Testing)
mirrorlist = http://updates.atomicorp.com/channels/mirrorlist/atomic-testing/centos-$releasever-$basearch
enabled = 0
priority = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt
        file:///etc/pki/rpm-gpg/RPM-GPG-KEY.atomicorp.txt
gpgcheck = 1
gpgcheck = 1



[root@dedicated yum.repos.d]# yum downgrade php, php-*


Loaded plugins: downloadonly, fastestmirror, priorities
Setting up Downgrade Process
Loading mirror speeds from cached hostfile
 * base: centos-distro.cavecreek.net
 * extras: centos.mirror.ndchost.com
 * rpmforge: mirror.webnx.com
 * updates: mirror.us.oneandone.net
base                                                                                                                                          | 3.7 kB     00:00
extras                                                                                                                                        | 3.4 kB     00:00
rpmforge                                                                                                                                      | 1.9 kB     00:00
updates                                                                                                                                       | 3.4 kB     00:00
No package php, available.
No Match for available package: php-acid-0.9.6b22-1.2.el6.rf.noarch
No Match for available package: php-adodb-4.81-1.el6.rf.noarch
No Match for available package: php-bcmath-5.3.3-38.el6.x86_64
No Match for available package: php-dba-5.3.3-38.el6.x86_64
No Match for available package: php-embedded-5.3.3-38.el6.x86_64
No Match for available package: php-enchant-5.3.3-38.el6.x86_64
No Match for available package: php-fpm-5.3.3-38.el6.x86_64
No Match for available package: php-intl-5.3.3-38.el6.x86_64
No Match for available package: php-jpgraph-1.19-1.2.el6.rf.noarch
No Match for available package: php-jpgraph-docs-1.19-1.2.el6.rf.noarch
No Match for available package: php-ldap-5.3.3-38.el6.x86_64
No Match for available package: php-odbc-5.3.3-38.el6.x86_64
Only Upgrade available on package: 1:php-pear-1.9.4-4.el6.noarch
No Match for available package: php-pear-db-1.7.13-2.el6.rf.noarch
No Match for available package: php-pecl-apc-devel-3.1.9-2.el6.i686
No Match for available package: php-pecl-apc-devel-3.1.9-2.el6.x86_64
No Match for available package: php-pecl-fileinfo-1.0.4-2.el6.rf.x86_64
No Match for available package: php-pecl-http-1.6.5-2.el6.rf.x86_64
No Match for available package: php-pecl-mailparse-2.1.5-2.el6.rf.x86_64
No Match for available package: php-pecl-session_mysql-1.9-2.el6.rf.x86_64
No Match for available package: php-pgsql-5.3.3-38.el6.x86_64
No Match for available package: php-process-5.3.3-38.el6.x86_64
No Match for available package: php-pspell-5.3.3-38.el6.x86_64
No Match for available package: php-recode-5.3.3-1.el6.rf.x86_64
No Match for available package: php-snmp-5.3.3-38.el6.x86_64
No Match for available package: php-tidy-5.3.3-1.el6.rf.x86_64
No Match for available package: php-xcache-1.3.2-1.el6.rf.x86_64
No Match for available package: php-xmlrpc-5.3.3-38.el6.x86_64
No Match for available package: php-zts-5.3.3-38.el6.x86_64
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:5.3.3-40.el6_6 will be a downgrade
---> Package php.x86_64 0:5.4.36-42.el6.art will be erased
---> Package php-cli.x86_64 0:5.3.3-40.el6_6 will be a downgrade
---> Package php-cli.x86_64 0:5.4.36-42.el6.art will be erased
---> Package php-common.x86_64 0:5.3.3-40.el6_6 will be a downgrade
---> Package php-common.x86_64 0:5.4.36-42.el6.art will be erased
---> Package php-devel.x86_64 0:5.3.3-40.el6_6 will be a downgrade
---> Package php-devel.x86_64 0:5.4.36-42.el6.art will be erased
---> Package php-gd.x86_64 0:5.3.3-40.el6_6 will be a downgrade
---> Package php-gd.x86_64 0:5.4.36-42.el6.art will be erased
---> Package php-imap.x86_64 0:5.3.3-40.el6_6 will be a downgrade
---> Package php-imap.x86_64 0:5.4.36-42.el6.art will be erased
---> Package php-mbstring.x86_64 0:5.3.3-40.el6_6 will be a downgrade
---> Package php-mbstring.x86_64 0:5.4.36-42.el6.art will be erased
---> Package php-mcrypt.x86_64 0:5.3.3-1.el6.rf will be a downgrade
---> Package php-mcrypt.x86_64 0:5.4.36-42.el6.art will be erased
---> Package php-mysql.x86_64 0:5.3.3-40.el6_6 will be a downgrade
---> Package php-mysql.x86_64 0:5.4.36-42.el6.art will be erased
---> Package php-pdo.x86_64 0:5.3.3-40.el6_6 will be a downgrade
---> Package php-pdo.x86_64 0:5.4.36-42.el6.art will be erased
---> Package php-pecl-apc.x86_64 0:3.1.9-2.el6 will be a downgrade
---> Package php-pecl-apc.x86_64 0:3.1.15-0.6.svn329913.el6.art will be erased
---> Package php-pecl-memcache.x86_64 0:3.0.5-4.el6 will be a downgrade
---> Package php-pecl-memcache.x86_64 0:3.0.8-3.el6.art will be erased
---> Package php-soap.x86_64 0:5.3.3-40.el6_6 will be a downgrade
---> Package php-soap.x86_64 0:5.4.36-42.el6.art will be erased
---> Package php-xml.x86_64 0:5.3.3-40.el6_6 will be a downgrade
---> Package php-xml.x86_64 0:5.4.36-42.el6.art will be erased
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================================================
 Package                                      Arch                              Version                                    Repository                           Size
=====================================================================================================================================================================
Downgrading:
 php                                          x86_64                            5.3.3-40.el6_6                             updates                             1.1 M
 php-cli                                      x86_64                            5.3.3-40.el6_6                             updates                             2.2 M
 php-common                                   x86_64                            5.3.3-40.el6_6                             updates                             527 k
 php-devel                                    x86_64                            5.3.3-40.el6_6                             updates                             511 k
 php-gd                                       x86_64                            5.3.3-40.el6_6                             updates                             109 k
 php-imap                                     x86_64                            5.3.3-40.el6_6                             updates                              53 k
 php-mbstring                                 x86_64                            5.3.3-40.el6_6                             updates                             458 k
 php-mcrypt                                   x86_64                            5.3.3-1.el6.rf                             rpmforge                             42 k
 php-mysql                                    x86_64                            5.3.3-40.el6_6                             updates                              84 k
 php-pdo                                      x86_64                            5.3.3-40.el6_6                             updates                              78 k
 php-pecl-apc                                 x86_64                            3.1.9-2.el6                                base                                 96 k
 php-pecl-memcache                            x86_64                            3.0.5-4.el6                                base                                 60 k
 php-soap                                     x86_64                            5.3.3-40.el6_6                             updates                             143 k
 php-xml                                      x86_64                            5.3.3-40.el6_6                             updates                             106 k

Transaction Summary
=====================================================================================================================================================================
Downgrade    14 Package(s)

Total download size: 5.5 M
Is this ok [y/N]: y
Downloading Packages:
(1/14): php-5.3.3-40.el6_6.x86_64.rpm                                                                                                         | 1.1 MB     00:01
(2/14): php-cli-5.3.3-40.el6_6.x86_64.rpm                                                                                                     | 2.2 MB     00:02
(3/14): php-common-5.3.3-40.el6_6.x86_64.rpm                                                                                                  | 527 kB     00:00
(4/14): php-devel-5.3.3-40.el6_6.x86_64.rpm                                                                                                   | 511 kB     00:00
(5/14): php-gd-5.3.3-40.el6_6.x86_64.rpm                                                                                                      | 109 kB     00:00
(6/14): php-imap-5.3.3-40.el6_6.x86_64.rpm                                                                                                    |  53 kB     00:00
(7/14): php-mbstring-5.3.3-40.el6_6.x86_64.rpm                                                                                                | 458 kB     00:00
(8/14): php-mcrypt-5.3.3-1.el6.rf.x86_64.rpm                                                                                                  |  42 kB     00:00
(9/14): php-mysql-5.3.3-40.el6_6.x86_64.rpm                                                                                                   |  84 kB     00:00
(10/14): php-pdo-5.3.3-40.el6_6.x86_64.rpm                                                                                                    |  78 kB     00:00
(11/14): php-pecl-apc-3.1.9-2.el6.x86_64.rpm                                                                                                  |  96 kB     00:00
(12/14): php-pecl-memcache-3.0.5-4.el6.x86_64.rpm                                                                                             |  60 kB     00:00
(13/14): php-soap-5.3.3-40.el6_6.x86_64.rpm                                                                                                   | 143 kB     00:00
(14/14): php-xml-5.3.3-40.el6_6.x86_64.rpm                                                                                                    | 106 kB     00:00
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                501 kB/s | 5.5 MB     00:11
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : php-common-5.3.3-40.el6_6.x86_64                                                                                                                 1/28
warning: /etc/php.ini created as /etc/php.ini.rpmnew
  Installing : php-cli-5.3.3-40.el6_6.x86_64                                                                                                                                                    2/28
  Installing : php-5.3.3-40.el6_6.x86_64                                                                                                                                                        3/28
Moving Zend extensions from php.ini to conf.d/zend_extensions_psa.ini and disabling custom ionCube if any... Removing php.ini backup files... done
Trying to register the ionCube loader... done
  Installing : php-pdo-5.3.3-40.el6_6.x86_64                                                                                                                                                    4/28
  Installing : php-mysql-5.3.3-40.el6_6.x86_64                                                                                                                                                  5/28
  Installing : php-devel-5.3.3-40.el6_6.x86_64                                                                                                                                                  6/28
  Installing : php-imap-5.3.3-40.el6_6.x86_64                                                                                                                                                   7/28
  Installing : php-xml-5.3.3-40.el6_6.x86_64                                                                                                                                                    8/28
  Installing : php-mbstring-5.3.3-40.el6_6.x86_64                                                                                                                                               9/28
  Installing : php-pecl-apc-3.1.9-2.el6.x86_64                                                                                                                                                 10/28
  Installing : php-gd-5.3.3-40.el6_6.x86_64                                                                                                                                                    11/28
  Installing : php-mcrypt-5.3.3-1.el6.rf.x86_64                                                                                                                                                12/28
  Installing : php-soap-5.3.3-40.el6_6.x86_64                                                                                                                                                  13/28
  Installing : php-pecl-memcache-3.0.5-4.el6.x86_64                                                                                                                                            14/28
warning: /etc/php.d/memcache.ini created as /etc/php.d/memcache.ini.rpmnew
  Cleanup    : php-5.4.36-42.el6.art.x86_64                                                                                                                                                    15/28
  Cleanup    : php-devel-5.4.36-42.el6.art.x86_64                                                                                                                                              16/28
  Cleanup    : php-cli-5.4.36-42.el6.art.x86_64                                                                                                                                                17/28
  Cleanup    : php-gd-5.4.36-42.el6.art.x86_64                                                                                                                                                 18/28
  Cleanup    : php-mbstring-5.4.36-42.el6.art.x86_64                                                                                                                                           19/28
  Cleanup    : php-soap-5.4.36-42.el6.art.x86_64                                                                                                                                               20/28
  Cleanup    : php-xml-5.4.36-42.el6.art.x86_64                                                                                                                                                21/28
  Cleanup    : php-mysql-5.4.36-42.el6.art.x86_64                                                                                                                                              22/28
  Cleanup    : php-pdo-5.4.36-42.el6.art.x86_64                                                                                                                                                23/28
  Cleanup    : php-mcrypt-5.4.36-42.el6.art.x86_64                                                                                                                                             24/28
  Cleanup    : php-imap-5.4.36-42.el6.art.x86_64                                                                                                                                               25/28
  Cleanup    : php-common-5.4.36-42.el6.art.x86_64                                                                                                                                             26/28
  Cleanup    : php-pecl-memcache-3.0.8-3.el6.art.x86_64                                                                                                                                        27/28
  Cleanup    : php-pecl-apc-3.1.15-0.6.svn329913.el6.art.x86_64                                                                                                                                28/28
  Verifying  : php-imap-5.3.3-40.el6_6.x86_64                                                                                                                                                   1/28
  Verifying  : php-cli-5.3.3-40.el6_6.x86_64                                                                                                                                                    2/28
  Verifying  : php-5.3.3-40.el6_6.x86_64                                                                                                                                                        3/28
  Verifying  : php-common-5.3.3-40.el6_6.x86_64                                                                                                                                                 4/28
  Verifying  : php-pdo-5.3.3-40.el6_6.x86_64                                                                                                                                                    5/28
  Verifying  : php-xml-5.3.3-40.el6_6.x86_64                                                                                                                                                    6/28
  Verifying  : php-mbstring-5.3.3-40.el6_6.x86_64                                                                                                                                               7/28
  Verifying  : php-mysql-5.3.3-40.el6_6.x86_64                                                                                                                                                  8/28
  Verifying  : php-pecl-apc-3.1.9-2.el6.x86_64                                                                                                                                                  9/28
  Verifying  : php-gd-5.3.3-40.el6_6.x86_64                                                                                                                                                    10/28
  Verifying  : php-devel-5.3.3-40.el6_6.x86_64                                                                                                                                                 11/28
  Verifying  : php-mcrypt-5.3.3-1.el6.rf.x86_64                                                                                                                                                12/28
  Verifying  : php-soap-5.3.3-40.el6_6.x86_64                                                                                                                                                  13/28
  Verifying  : php-pecl-memcache-3.0.5-4.el6.x86_64                                                                                                                                            14/28
  Verifying  : php-imap-5.4.36-42.el6.art.x86_64                                                                                                                                               15/28
  Verifying  : php-mcrypt-5.4.36-42.el6.art.x86_64                                                                                                                                             16/28
  Verifying  : php-pecl-apc-3.1.15-0.6.svn329913.el6.art.x86_64                                                                                                                                17/28
  Verifying  : php-mysql-5.4.36-42.el6.art.x86_64                                                                                                                                              18/28
  Verifying  : php-xml-5.4.36-42.el6.art.x86_64                                                                                                                                                19/28
  Verifying  : php-soap-5.4.36-42.el6.art.x86_64                                                                                                                                               20/28
  Verifying  : php-pecl-memcache-3.0.8-3.el6.art.x86_64                                                                                                                                        21/28
  Verifying  : php-5.4.36-42.el6.art.x86_64                                                                                                                                                    22/28
  Verifying  : php-gd-5.4.36-42.el6.art.x86_64                                                                                                                                                 23/28
  Verifying  : php-cli-5.4.36-42.el6.art.x86_64                                                                                                                                                24/28
  Verifying  : php-pdo-5.4.36-42.el6.art.x86_64                                                                                                                                                25/28
  Verifying  : php-common-5.4.36-42.el6.art.x86_64                                                                                                                                             26/28
  Verifying  : php-mbstring-5.4.36-42.el6.art.x86_64                                                                                                                                           27/28
  Verifying  : php-devel-5.4.36-42.el6.art.x86_64                                                                                                                                              28/28

Removed:
  php.x86_64 0:5.4.36-42.el6.art              php-cli.x86_64 0:5.4.36-42.el6.art         php-common.x86_64 0:5.4.36-42.el6.art                     php-devel.x86_64 0:5.4.36-42.el6.art
  php-gd.x86_64 0:5.4.36-42.el6.art           php-imap.x86_64 0:5.4.36-42.el6.art        php-mbstring.x86_64 0:5.4.36-42.el6.art                   php-mcrypt.x86_64 0:5.4.36-42.el6.art
  php-mysql.x86_64 0:5.4.36-42.el6.art        php-pdo.x86_64 0:5.4.36-42.el6.art         php-pecl-apc.x86_64 0:3.1.15-0.6.svn329913.el6.art        php-pecl-memcache.x86_64 0:3.0.8-3.el6.art
  php-soap.x86_64 0:5.4.36-42.el6.art         php-xml.x86_64 0:5.4.36-42.el6.art

Installed:
  php.x86_64 0:5.3.3-40.el6_6           php-cli.x86_64 0:5.3.3-40.el6_6            php-common.x86_64 0:5.3.3-40.el6_6     php-devel.x86_64 0:5.3.3-40.el6_6     php-gd.x86_64 0:5.3.3-40.el6_6
  php-imap.x86_64 0:5.3.3-40.el6_6      php-mbstring.x86_64 0:5.3.3-40.el6_6       php-mcrypt.x86_64 0:5.3.3-1.el6.rf     php-mysql.x86_64 0:5.3.3-40.el6_6     php-pdo.x86_64 0:5.3.3-40.el6_6
  php-pecl-apc.x86_64 0:3.1.9-2.el6     php-pecl-memcache.x86_64 0:3.0.5-4.el6     php-soap.x86_64 0:5.3.3-40.el6_6       php-xml.x86_64 0:5.3.3-40.el6_6

Complete!
Categories PHP