Posts

app/storage/meta/services.json: failed to open stream: Permission denied - Laravel 4

If you are getting this error on your laravel 4 installation so put the steps as i mention below Error is like this in laravel 4 ErrorException file_put_contents(/var/www/vhosts/folder/app/storage/meta/services.json): failed to open stream: Permission denied  That means permission is not granted to write for meta folder so you need to run these command on your server from your root folder Step 1: Come to your root folder var/www/vhosts/yousite_folder/ Step 2: Run this command first find app/storage -type d -exec chmod 777 {} \; Step 3: Run this command now find app/storage -type f -exec chmod 777 {} \; These command will chmod all directories and files in app/storage to 777.  Done!! Now you can refresh your page and working fine. If this post help you please submit a comment in post to inspire me :)

chown: invalid user: `www:www'" - Error in CentOS

chown: invalid user: `www:www'"  - Error in CentOS When i grant ownership of the directory to the user, instead of just keeping it on the root system i got this error chown: invalid user: `www:www'" How to solve this. When you use this command "sudo chown -R www:www /var/www/example.com/public_html". ? You got an error here are the solution that how can you handle this Just replace the www:www to apache:apache Example: sudo chown -R apache:apache /var/www/example.com/public_html

wget: command not found

Error can like like this wget: command not found Or -bash: wget: command not found This error occurs if wget  is not installed on your server. Might be you have a VPS server. That means  you don't have wget installed Try this command yum install wget Now try wget command to download the package from server. Hope this will work now. If this post help you so do not forget to comment for this post

How to login MySql in CentOS Or Linux?

How to login MySql in CentOS Or Linux? Here i will show you that how can you use MySql on CentOS or Linux Os Open Your terminal and login with your root login now run this command to login in mysql mysql -u root -p It will ask you for password Enter password: Enter your password here which you have set for mysql It will show show you a successfull message OR insert mysql as selected tab mysql> Two points you must keep in your mind: 1) All MySQL commands end with a semicolon; if does not end with a semicolon, the command will not execute. 2) MySQL commands are usually written in uppercase and databases, tables, usernames, or text are in lowercase to make them easier to distinguish. MySQL command line is not case sensitive. To show all database: SHOW DATABASES; Use exit command to come out from the mysql> promt mysql> exit it will show msg bye

How to write MySql Query in laravel?

I will show a simple query in laravel where you can easily understand that how query works in laravel 4. $limit = 5; $value= Bank::where('isactive','=','yes')->where('money','>',0)->whereNotNull('account')->whereNull('credit')->take($limit)->orderBy('id', 'DESC')->get(); This query act like as query below select * from Bank where money>0 amd account!=null and credit='' order by id desc limit 0,5. This is the representation that how laravel query works i added here where condition with 3 different ways and limti and order by for this query This query will work for both Database MYSQL MongoDB

How to get XML response output in laravel?

How to get XML response output in laravel? or How to create XML response output in laravel? or Most of developers use header function to create xml file but this does not work header('Content-type: application/xml'); $output  = "<?xml version='1.0' encoding='UTF-8'?>"; here i will tell you that how can you show or save XML response output in laravel you have an array where you have data Here is an example that how can you create xml file response in laravel suppose you have an array which have twitter data //Preapre our output for xml data $output  = "<?xml version='1.0' encoding='UTF-8'?>"; $output .= "\n<twitterfeed>\n"; $j=0; foreach($twitterinfo as $row){ $j++; $output .= "<feed>\n"; $output .= "<id>" . $j . "</id>\n"; $output .= "<twitter_id>" . $row['twitter_id'] . "</twitter_id>\n"

How to rename a field from a collection in mongoDB?

How to rename a field from a collection in mongoDB? By this query you can rename a field from whole collection in mongoDB db.colleciton.update(     //  where query like: where active="yes"     {         "active" : "yes"     },       // will remove Name field from current collection     {         $rename: {"Name":"Username"}     },       // options     {         "multi" : true  // update all document     } ); or you can copy and paste this code above code is with comment that how mongoDB query works db.colleciton.update(     {         "active" : "yes"     },     {         $rename: {"Name":"Username"}     },     {         "multi" : true     } );