Skip to main content

Posts

Featured Post

Repair Centos Metadata Corruption

Recent posts

Access phpMyAdmin from remote computer

Often in the software implementation process we need phpMyAdmin access via a computer other than the server. When passing through the access we get a message: Forbidden You do not have permission to access `phpmyadmin` on this server. To complete this, edit the /etc/httpd/conf.d/phpMyAdmin.conf file by adding the Require all granted line <Directory / usr / share / phpMyAdmin />    AddDefaultCharset UTF-8    <IfModule mod_authz_core . c >      # Apache 2.4      <RequireAny>        #Require ip 127.0.0.1        #Require ip ::1        Require all granted      </RequireAny>    </IfModule>    <IfModule ! mod_authz_core . c >      # Apache 2.2      Order Deny,Allow      Deny from All      Allow from 127.0.0.1      Allow from ::1    </IfModule> </Directory>   Restart your httpd service : #service httpd restart Thank you for reading this blog. Hope this helps you.

Make display inline radioButtonList on Yii Framework

By Default Yii display radioButtonList not inline like this : $form->radioButtonList($model, 'gender', array('M' => 'Male', 'F' => 'Female')) Change Code like this $form->radioButtonList($model, 'gender', array('M' => 'Male', 'F' => 'Female'), array( 'labelOptions' => array('style' => 'display:inline'), 'separator' => ' ')) And Voila ... ! Thank's

Cascade delete parent child relation on Yii

Hello All, Sometimes we want to delete parent table on parent child relation on Yii, First we must set relation, Parent Model : public function relations() { return array( 'Childs' => array(self::HAS_MANY, 'ChildModel', 'parent_id'), ); } Child Model : public function relations() { return array( 'Parent' => array(self::BELONGS_TO, 'ParentModel', 'parent_id'), ); } On delete parent, at function below (parent model) : public function beforeDelete(){ foreach($this->Childs as $c) $c->delete() return parent::beforeDelete(); } That's all. Hope this post can help you.

Change Landing Page Yii Framework

In certain conditions , we want the first page of our application do directly into actual applications , but we want to explain in detail the application . To do that we can redirect the application to a specific page by changing main.php at the directory config . 'defaultController' = 'controller/action' , Example :     return array ( ...   ' defaultController ' =>home /index , ...   ); Thx

Export and import big data mysql with mysqldump

To export big data on mysql use this command: # mysqldump -u [username] -p [databasename] | gzip > [filename.sql.gz] To import big data on mysql First you must extract compress file  [filename.sql.gz] to [filename.sql] #mysql -u  [username] -p mysql> use [databasename]; mysql> source path/to/ [filename.sql];  If your data is too big, the import process can be used long time, wait until finished. If not you must try from Import process. Thx.