المشاركات

عرض المشاركات من مايو, ٢٠١٨

How to Install Composer on Windows with XAMPP

صورة
Now-a-days, many modern php frameworks like laravel, symfony, codeigniter and other libraries use the composer to manage their dependencies. So you need composer to install them on your machine. In case you don't know, Composer is the tool for dependency management in php . It allows you to declare the dependency libraries and packages required for a project and it will install, update and manage them for you. Composer will never maintain anything globally by default but rather on per-project basis. You need PHP 5.3.2 and above to use Composer. So make sure the system requirements are met before installing it on your machine. In addition, you must also make some changes to the php settings to make it work. Change Settings on php.ini: I hope you have XAMPP installed already on your machine. So before composer installation, do the following changes on your php.ini file. Go to [path-to-xampp]/php folder and open php.ini file. Locate the below lines one by one and remove th

How to Change Apache and MySQL Port Number in XAMPP Localhost

صورة
Hi! I'm going to show you how to change the apache and mysql port number in xampp localhost . In case you wonder why you should change the port number of a web server, here is the answer. It's not unlikely for you to run multiple PHP versions on a same machine or to run IIS or JBoss simultaneously with Apache. When you start a web server, it occupies the default HTTP port '80'. If you try to run the second one, it will fail since the port is already occupied. So unless you change the port for the latter, you can't run more than one web server at once. Below we will see the ways to change the port no. for apache and mysql. To Change Apache Port Number: Stop Apache server and exit XAMPP control panel if it is already running. First you must change the HTTP port. Go to [path-to-xampp-folder]/apache/conf folder and open http.conf file. The default port for Apache is '80'. Unless you have changed it, this is the port number you must replace. Now look f

How to Convert PDF to JPEG Image in PHP

صورة
Hi! Today let's see how to convert pdf to jpeg in php using imagick . PHP offers some good native extensions for image processing. Imagick is one of those extensions with which we can easily create JPEG images from pdf without the need for third-party tools. The library does not need installation since it comes built-in with PHP. You just have to instantiate the class and use it. Plus it provides several customization options to create images. I suggest you to refer the official documentation for the complete list of functions. PHP - Convert PDF File to JPEG: Imagick is the native php extension to create and process images using the ImageMagick API . To covert the pdf into jpeg with imagick, you must first read the image from the pdf file and then write it into an image. The following example converts all the pages in a pdf file into jpeg images. <?php $imagick = new Imagick(); $imagick->readImage('mypdf.pdf'); $imagick->writeImages('myimage.jpg', fa