How to configure Zend Framework on an Apache server in a PLESK environment?

First, download the Zend framework and unzip the file contents to a location. At the time of the writing ZendFramework-1.11.12 was in use and we have used that version in this example. Key content of the download is the /library folder which has Zend libraries in it.

Then, go to the “conf” folder that was created when the site was created.

Inside the conf folder, create a new file and name it vhost.conf

Add the below contents to vhost.conf and save it. Continue Reading…

RFC 3339 date format in RSS Feeds

RSS Feeds use RFC 3339 date format in their XML/Atom feeds.

Date formats have often caused confusion in the development, interoperability and maintenance of software applications. To improve the consistency in use of Date and Time, RFC 3339 came into existence which uses Coordinated Universal Time (UTC).

For PHP versions < 5.2,


$dateRFC = "2008-12-01T13:30:00.000-04:00";
$myDate = date('d.m.Y', strtotime($dateRFC)); // 01.12.2008

For PHP versions >= 5.2,


$dateRFC = "2008-12-01T13:30:00.000-04:00";
$myDate = new DateTime($dateRFC);
$dateStr = date('d.m.Y', strtotime($dateRFC)); // 01.12.2008

Read: IETF: RFC 3339

PRG – Post Redirect Get design pattern to redirect after Post

Post Redirect Get (PRG) is one of the design patterns used in web applications to prevent double post or duplicate form submissions which often happens with a page refresh or reload.

When a form is submitted to the server with information, the server responds back with HTML content. When this content is directly displayed on the browser and when the user refreshes the page, the form gets submitted twice. As the content is a response to POST it cannot be bookmarked as well.

To avoid these problems, applications use PRG design pattern which will redirect users to a page instead of displaying the POST response.

More information on the PRG design pattern is available on Wikipedia

How to Send Emails from your local WAMP XAMPP server in windows?

… a question that raises in the mind of programmers developing applications in their local development environments.

This can be achieved by making the following modifications.

Step (i) Install the WAMP / XAMPP server in your windows machine. After this install you will be able to access sites created on the localhost with URL http://localhost

Step (ii) Download and extract the send mail application for Windows from http://glob.com.au/sendmail/. Remember the path where you have extracted sendmail. For e.g. c:\wamp\sendmail

Step (iii) Edit sendmail.ini within c:\wamp\sendmail. This ini file has enough documentation explaining how the configuration changes should happen on the file.
Continue Reading…

How to check if linux server can send out email via command line?

Method 1:

$ mail -s “Subject: Test email from linux server” info@test.com

Press the “Return” key

Enter the body part of the email

Press ctrl + D

Enter a CC email if you would like (e.g. info2@test.com)

Press ctrl + D again

Then check the mail box to see if the mail has arrived.

Continue Reading…

Reverse DNS and Junk Email

Many email servers depend on Reverse DNS in order to identify if the mail is legit or spam. For the Reverse DNS to work correctly, two points need to be addressed
a) Look for IP address of the mail server should return its name. PTR record should be set for this
b) Reverse look on the name should return back the IP address

For example,

$ dig -x 217.83.122.34

;; ANSWER SECTION:

34.122.83.217.in-addr.arpa. 66372 IN PTR mail.example.com.

$ dig mail.example.com

;; ANSWER SECTION:

mail.example.com. 900 IN A 217.83.122.34

Check the IP address that is getting resolved matches the name that is getting returned back.

Linux: How to upgrade PHP from 5.1 to 5.2 in CentOS5?

First Check PHP version that is currently installed

$ php -version

Check Linux Version

$ cat /etc/*-release (or redhat-release)

Create a repo file with the content given below. As you can note, we are looking for package upgrade related to php only.
Continue Reading…

SEO: Steps to take after submitting to search engines

Part 5: Steps to take after submitting to search engines (from the web)

Maintenance check

All Web sites should be thoroughly tested using a site maintenance tool in order to catch errors in operation before customers are brought to the site. HTML errors can hinder a search engine spider’s ability to index a site, it can also keep a search engine from reading a page or cause it to be viewed in a manner different from how it was intended. NetMechanic’s HTML Toolbox or another site maintenance tool, must be used by the Webmaster, to avoid potential visitor disasters due to site errors. Continue Reading…

Linux: How to list or allow access to ports ?

SELinux is a feature that may be turned on certain servers and it can restrict access to certain ports. In order to gain access and make the ports work, you need to open those ports.

To see if SELinux is set, type

$ sestatus

To list all port, try the semanage command

$ semanage port -l

To check for a specific port that is opened

$ semanage port -l | grep 8085

To allow access to a specific port

$ semanage port -a -t http_port_t -p tcp 8085

MySQL: ‘Access denied for user ‘root’@’localhost’ (using password: YES)’

The above error message most likely occurs when users change password in one environment (via command line or phpmyadmin) and do not see the changes reflect in other OR if they have forgotten the password that is being set for the environment in question.

Following command should help you set/change MySQL password

$ mysql -u root -p
Continue Reading…

Kurinchi Calendar
October 2018
M T W T F S S
« Oct    
1234567
891011121314
15161718192021
22232425262728
293031