One Liner to test php sending mail from a bash script

To check if your php installation can successfully send emails from a bash script try this :

 php -r ‘var_dump(mail(“david.saliba@testemail.com”, “test subject”, “test body”));’

Thanks Gareth !

nJoy 🙂 !

Test if memcache is installed in php from bash line

php -i | grep -i memcache

Short and sweet
sample output :

memcache
memcache support => enabled
memcache.allow_failover => 1 => 1
memcache.chunk_size => 8192 => 8192
memcache.default_port => 11211 => 11211
memcache.default_timeout_ms => 1000 => 1000
memcache.hash_function => crc32 => crc32
memcache.hash_strategy => standard => standard
memcache.max_failover_attempts => 20 => 20
memcached
memcached support => enabled
libmemcached version => 0.50
Registered save handlers => files user memcache memcached

Njoy 🙂

Php pecl config error on centos

When installing php PECL On CentOS/RHEL (+cPanel) installations, if you get a “checking whether the C compiler works… configure: error: cannot run C compiled programs”, you may need to remount the /tmp and /var/tmp with exec permissions first:

$ mount -o remount,exec,suid /tmp
$ mount -o remount,exec,suid /var/tmp

Then:

$ pecl install {package}

And, don’t forget to remount them as noexec after.