Posts

How to use DOMDocument in PHP?

DOMDocument is PHP library, which will be used to read, write and manipulate XML and HTML Documents. DOM (Document Object Model) is kind of API to validate the content of XML/ HTML. DOM support different namespaces as well. The above code is demonstrating about DOMDocument usage with sample example. The example will fetch all H2 tags from the content and will form as separate list view. To Discard White Spaces in content

Generating SSH Public Key for GIT

Version controlling is one of the most important software life cycle processes. We have to maintain our code base on remote repository with version control functionality. For remote repository and version control, we have GIT and SVN. In GIT, I am going to give you the steps to get and add SSH authenticate key. Please follow the below commands to get SSH key from Linux machine. cd ~/.ssh ssh-keygen cat ~/.ssh/id_rsa.pub Once you done the below commands, you can copy the content of CAT command and paste into notepad. After you pasted in notepad, if you find any space on end of the content, please remove the space and copy the content and paste on SSH Key in Git hub account.

CURL error code 7 in php

Curl is one of most powerful functionality in PHP. It will allow us to communicate with external URL. To use the curl functionality in your code. We must enable PHP curl module in PHP installation. In this post, i could like to explain about curl error code "7". There are some of the criteria to get this error. Due to wrong URL. URL might have some port on postfix. For Example: http://xx.xxx.xxx.xx:8080/ Solution : To solve this issue, we must remove the port on URL.Your URL must be like http://xx.xxx.xxx.xx/

Libmemcached cinttypes problem on complie using gc++ complier for memcached library

--------------------------------------------------------------------------------------------------------- Problem --------------------------------------------------------------------------------------------------------- The compilation failed on a configure without any options: ----   CXX libhashkit/libhashkit_libhashkit_la-behavior.lo   CXX libhashkit/libhashkit_libhashkit_la-crc32.lo   CXX libhashkit/libhashkit_libhashkit_la-digest.lo   CXX libhashkit/libhashkit_libhashkit_la-encrypt.lo   CXX libhashkit/libhashkit_libhashkit_la-fnv_32.lo   CXX libhashkit/libhashkit_libhashkit_la-fnv_64.lo   CXX libhashkit/libhashkit_libhashkit_la-function.lo   CXX libhashkit/libhashkit_libhashkit_la-has.lo   CXX libhashkit/libhashkit_libhashkit_la-hashkit.lo   CXX libhashkit/libhashkit_libhashkit_la-jenkins.lo   CXX libhashkit/libhashkit_libhashkit_la-ketama.lo   CXX libhashkit/libhashkit_libhashkit_la-md5.lo   CXX libhashkit/libhashkit_libhashkit_la-murmur.lo   CXX libhashkit/libhashkit_libhashk

How to add cron job in CentOS(UNIX/LINUX)

CRON Job is one of the most powerful system in UNIX system. Cron job will be execute by unix system by certain time interval on regular basis. It will allow to schedule your script to run on background without affecting your current task on UNIX machine. Here i will give you real time example for CentOS. Cron jobs can be schedule on two different ways, System cron job and user defined cron jobs. System jobs will be defined by root privilege user. This will allow your unix system to perform there system related job on certain interval basis. User defined cron jobs can be defined by any of the user with their user privilege. Location of crontab in CentOS - /etc/crontab The below command will allow you to edit the cron file to add your job. crontab -e Here the syntax for adding your cron job into cron file. 1 2 3 4 5 /path/to/your-filename arg1 arg2 What is 1, 2, 3, 4, 5? 1 - Minute (0-59) 2 - Hours (0-23) 3 - Days of month(1-31) 4 - Month (1-12) 5 - Week days (0 -7)

How to use SCP command in windows

SCP command is one of the most powerful command in linux to transfer files in secure way. It can be use for windows. Here the link to download link for windows. After you download the file into you local machine. Please go to command prompt and go to location of pscp.exe. From there you need to execute the following commands to download and upload a file. Please use below command to download file to local from server location. Please use below command to upload file from local to server location.

How to setup virtual host in apache2 on ubuntu OS

Virtual host is one of the beautiful option, which is provided by web servers. I have already shared the snacks about XAMPP virtual host creating process. I believe that snacks was tasty and delightful for your coding life. Here, i am sharing another tasty snacks about Apache2 server virtual host, which is default server of most of linux OS. In order to create virtual host in your linux machine with apache2 server. First you have to place your project folder under root directory (/var/www/). Create virtual host file in below location with tags Step 1 : Go to cd /etc/apache2/sites-available/ Step 2 : cp default yoursitename.com Step 3 : Open your file with following command sudo gedit  yoursitename.com Paste the below code into yoursitename.com file. <VirtualHost *:80>     ServerAdmin test@test.com     DocumentRoot /var/www/project-directory/     ServerName yoursitename.com         ServerAlias www.yoursitename.com         ErrorLog /var/log/apache2/yoursitename.co