Tag: PHP

YII Command tool not working

Problem: YII Command tool was not working in the newly created YII application, While using the below command in the command prompt not getting any respond, but normally its work with other YII application. Every path has been configured correctly and not getting any errors. /var/www/yii-1.1.16/framework/yiic shell Screenshot: Solution: This caused due to access rules …

Continue reading

Permanent link to this article: https://blog.openshell.in/2015/03/yii-command-tool-not-working/

How to read large XML files efficiently using PHP?

Recently I was faced problem of parsing large XML file using PHP. While parsing small files are no problem and all its quickly parsed, an attempt to parse larger files often causes time-out or Internal Sever Error. We will not able to use DOM or SimpleXML extension to parse the large XML documents in PHP. …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/09/how-to-read-large-xml-files-efficiently-using-php/

Create URL Slug from Post Title using PHP

The following functions will helps to create search engine optimization url for the website. This will strip all the special characters and punctuation away from the URL and place hyphen in between each words. For acheving the required results, used regular expression function that replaces spaces between words with hyphens and its remove the special …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/08/create-url-slug-from-post-title-using-php/

phpmyadmin – Cannot start session without errors, please check errors

Unfortunately sometimes we get the problem with phpMyAdmin, here is the error from phpMyAdmin on ubuntu machine. phpMyAdmin – Error [code] Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly. [/code] To find out where the session.save path http://wiki.phpmyadmin.net/pma/session.save_path run this script …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/06/phpmyadmin-cannot-start-session-without-errors-please-check-errors/

How to use Jsonp method in JQuery

JSONP is JQuery(JavaScript) method used to request data from a server in a different domain, something prohibited by typical web browsers because of the same-origin policy. JSONP takes advantage of the fact that browsers do not enforce the same-origin policy on<script> tags. JSONP is a viable solution for cross-domain Ajax. JSONP does not work with …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/06/how-to-use-jsonp-method-in-jquery/

How to declare dependencies and use composer in php

Using Composer: We will now use Composer to install the dependencies of the project. To use Composer in your project, you’ll need one file: composer.json. In this file you will describe the dependencies of your project. So let’s create the file: [code]vim composer.json[/code] Declaring Dependencies: Once you created a composer.json file within your project which …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/05/how-to-declare-dependencies-and-use-composer-in-php/

How To Install and Use Composer on Ubuntu

Introduction Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs and it will install them in your project for you. Dependency management Composer is not a package manager. Yes, it deals with “packages” or libraries, but it manages them on a per-project basis, installing …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/04/how-to-install-and-use-composer-on-ubuntu/

How to download file from remote URL in PHP

There are many ways in PHP to download file from the remote server. We can use php functions like copy, file_get_content, fopen, fsockopen & Curl to download the remote files. For your reference here I have explained about copy, fopen and Curl method, I have choosen these methods based on simplify and easily everyone can …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/03/how-to-download-file-from-remote-url-in-php/

Serailization & Unserialization in PHP

Serialization which help us to store or transport PHP data structure such as an array or object. All the storage meduim or database can store String type. It will generates a storable representation of a value. This is useful for storing or passing PHP values around without losing their type and structure. Essentially, it takes a …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/01/serailization-unserialization-in-php/

Dynamically create form in javascript on fly

To create a form dynamically using JavaScript on fly of the webpage. This which helps to create form and input controls dynamically. [javascript] /* To create form with javascript */ var form = document.createElement("form"); form.setAttribute(‘method’,"post"); // form method form.setAttribute(‘action’,"test.php"); // form action url form.setAttribute(‘name’,"frmName"); // form name form.setAttribute(‘id’,"frmId"); // form ID form.setAttribute(‘target’,"_blank"); // form target …

Continue reading

Permanent link to this article: https://blog.openshell.in/2013/12/dynamically-create-form-in-javascript-on-fly/