Use the following command for stop a process using port 80 .This example is based on Ubuntu Linux operating system. Commands need to run in terminal sudo netstat -lpn |grep :80 tcp6 0 0 :::80 :::* LISTEN 1185/apache2 sudo kill 1185
Category: SQL
Export large sql table data to csv using php(socialengine)
//function to download all users deatails to csv public function downloadcsvAction() { ob_end_clean(); set_time_limit(0); ini_set(‘memory_limit’, ‘2024M’); $this->_helper->viewRenderer->setNoRender(true); $this->_helper->layout->disableLayout(); $query=Engine_Db_Table::getDefaultAdapter()->select() ->from(‘engine4_users’,array(‘user_id’,’email’,’displayname’,’level_id’,’enabled’,’approved’,’intro_page’,’creation_date’)) ->where(‘user_id <> ?’, 1) ->where(‘user_id not in (?)’, array(‘685′,’870′,’948′,’965′,’1031′,’1249′,’1279′,’1283’)) ->where(‘user_id <> ?’, 6); $aResult= $query->query()->fetchAll(); $fileName = “users_”.time().’.csv’; header(‘Content-Type: application/csv’); header(‘Content-Disposition: attachement; filename=”‘.$fileName.’”‘); $f = fopen(‘php://output’, ‘w’) or show_error(“Can’t open php://output”); $n = 0; $line…
Maximum range of varchar in MySQL
Varchar() is a datatype in MySQL. The length of Varchar() is varies from 0 – 65,535. The important feature of this data type is ,it only using the bytes wants to store data,no wastage of memory.
How to see apache log error in Ubuntu
Type the following command in terminal to See apache log error in Ubuntu smarttips@smarttips-System-Product-Name:~$ tail -f /var/log/apache2/error.log
Import and export large database in phpmyadmin
Ubuntu use the terminal windows can use the command prompt for run the following command. command: sudo mysql -u root -p”root” ur database name < source sql file path Eg:sudo mysql -u root -proot projects_unii-v16</var/www/projects_unii-v16.sql