Dec 15

Execute PHP script from command line

After successful installation of PHP on the web servers, many people confuse how to execute PHP script from command line.
If you follow auto installation procedure such as yum or apt, then PHP CLI feature should be installed by default. If PHP installation done from
compiling source, then there is little steps to follow to get PHP CLI to work .

1) Find PHP bin file

First you should try to find PHP bin and make sure it exist

If PHP binary does exist, you will find path to binary file

If PHP binary does not exist, you may need to recompile PHP

2) Add PHP to bash profile

If PHP exists on your system, add the path to bash_profile

then replace the actual path of the PHP bin

3) save and reload the file

This is to ensure your current session has access to new path changes. otherwise you need to open fresh terminal windows.

4) Verify

now you should be able to run PHP script from cli

Dec 02

phpBB header banner advertisement

You are reading this because you are phpBB community forum owner , and looking forward to make some revenue from the forum.
If you wish to put phpBB header banner advertisement then you are landed to right page 🙂 . Here I would like to guide you how to add a 468×60 banner advertisement in phpBB forum’s header, which uses Prosilver theme. Before start you should be able to edit file of the server. If it VPS server you must have SSH or at least FTP connectivity to the server , if it shared hosting with Cpanel , then it is so easy as you can use Cpanel’s File  Manager.

1) Open overall_header.html file

location :- styles/prosilver/template/overall_header.html

2) Find below code snippet

3) Add following code after that

div style explanation

Put your banner advertisement code on commented area

right: 200px —>  banner right hand margin, you need to adjust it (should be increased most probably ), if it is overlap with forum search.

4) Save and exit

5) Clear forum cache

Log in to ACP of the forum. then, go General –> Purge the cache click on <Run Now>

sample site :- http://forum.tectut.com

Nov 17

Install PHP APC on Linux

This will guide you how to install PHP APC on Centos Linux. You may be aware that APC is little bit older and it is replaced by APCu.
If you really need to install APC, most of following steps are same, only thing you have to do it download latest stable APC version 🙂

1) Download latest APCu

https://pecl.php.net/package/APCu

2) Install PHP APCu

latest available version at the moment of writing is 4.0.7 .

Use following command to find out location of php-config file and append that path to –with-php-config .

3) configure PHP with APCu

Open php.ini file and add following line
extension=apcu.so

4) Verification

Restart the Apache server and open phpinfo page. then search apc , phpinfo gives you “apc” as emulated and apcu version. I hope this would help you !!

Older posts «

» Newer posts

Fetch more items