Posts

Showing posts from 2017

How to create a zip file in php?

$zip = new ZipArchive(); $file_name = "./myzip.zip"; if ($zip->open($file_name, ZIPARCHIVE::CREATE) !== TRUE) { exit("cannot open <$file_name>\n"); } try { //it will create new file add content $zip->addFromString("test_my_file.txt" . time(), "#1 String for testingsave as test_my_file.txt.\n"); //first part of original file and second part you wnat give name of file in zip $zip->addFile("test1.php", "test1.php") or die ("ERROR: Could not add file:"); $zip->addFile("test2.php", "test2.php") or die("ERROR: Could not add file:"); //test1.php and test2.php files must be exist } catch (Exception $e) { echo $e->getMessage(); exit; } echo "Zipped Files : " . $zip->numFiles . "\n"; echo "Status of Zip :" . $zip->status . "\n"; $zip->close();

How do we clear the terminal history in linux?

Open the terminal and run the following commands: 1. ~$ clear It will clear the screen only. 2. ~$ history -c then ~$ rm ~/.bash_history It will permanent clear the history.

How to import the database to mysql under linux?

Just follow the below steps: Method 1: 1. mysql -u root -p //Enter password 2. mysql>use your_db_name 3. mysql>SET autocommit=0 ; source database_file.sql ; COMMIT ; Method 2: mysql -u username -p password db_name < file.sql

CURL is not installed in your php installation

Open Terminal: 1. You have to need fisrt install CURL using sudo apt-get install curl 2. Now restart Apache by typing sudo service apache2 restart 3. Then install PHP5 CURL by typing sudo apt-get install php5-curl 4. It will ask yes or no so type y or yes! 5. Finally restart apache using second line command.

how-to-setup-apache-virtual-hosts-on-ubuntu

Just follow the below steps: 1. Open the terminal. 2. sudo –i 3. cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/test.mydomain.com.conf 4. gedit /etc/apache2/sites-available/test.mydomain.com.conf Change DocumentRoot /var/www/html/test.mydomain.com Add these lines: ServerName test.mydomain.com ServerAlias www. test.mydomain.com 5. a2ensite test.mydomain.com.conf 6. sudo service apache2 restart 7. apache2ctl -S //will display list of host to your system 8. sudo gedit /etc/hosts //Add your host name like 127.0.1.1 test.mydomain.com

How to enable mod_rewrite in Ubuntu 14.04 LTS?

Follow the below steps: - sudo a2enmod rewrite - sudo service apache2 restart - sudo gedit /etc/apache2/site-available/000-default.conf Now copy and paste this code to above file:     <Directory "/var/www/html">         AllowOverride All     </Directory> - sudo service apache2 restart

vtiger installation part 3

Image

vtiger installation part 2

Image

vtigercrm 6.4.0 installation part 1

Image