Friday, March 14, 2014

Add a new version of PHP to Wamp Server

To Add a new version of PHP to wamp server , Say you have php5.4.3 and you want to add a new version php5.5.8.

You have to follow these steps to be assure that you can run the new version in your wamp server :

 1. Copy the new php version folder to the php folder in Wamp/bin folder .
                       Example :
                                Wamp/bin/php/
                                                      /php5.4.3
                                                      /php5.5.8

  (Note: the first number must be attached directly to php, no space no dots) .

2.Create a new file and name it wampserver.conf in the new php folder(php5.5.8) .

 3.Copy the content of the wampserver.conf that reside in the last php version (php5.4.3) to the wampserver.conf of the new php version(php5.5.8).

4.make a copy of php.ini file in the new php version(5.5.8) folder and name it phpForApache.ini .

5. (if it is not Exist)Add the following  line to the new  phpForApache.ini :

        extension_dir = "d:/wamp/bin/php/php5.5.8/ext/" .

6. Add the following line to the end of the LoadModule section in httpd.conf file which reside in wamp/bin/apache/apache2.4.*/:

 LoadModule php5_module "d:/wamp/bin/php/php5.5.8/php5apache.dll".

 7.Also add the following  line :

;AddModule php5

(Note: these two line will be replaced by the contents in the wampserver.conf variables ,So it is not important what is written here as long as the line contain the two words "LoadModule" and "php" or "AddModule" and "php").

Thursday, March 6, 2014

Task 'default' was not defined in your gulpfile but you tried to run it Please check the documentation for proper gulpfile formatting.

Task 'default' was not defined in your gulpfile but you tried to run it Please check the documentation for proper gulpfile formatting.
This error happened when I was trying to minify a CSS file which was including @media tags ,I was trying to minify this file using Notepad++  Jstool plugin through JsMin command, but the this function cannot handle @media queries the right way and the output file will not maintain @media queries properly and the final Css file will be useless. So to solve this issue I had to install gulp and its gulp-minify-css plugin because  But when I created the gulpfile like this :

 
var gulp = require('gulp');
var minifyCSS = require('gulp-minify-css');
gulp.task('minify-css', function() {

  gulp.src('styles.css')
    .pipe(minifyCSS())
    .pipe(gulp.dest('./'));
});



 and tried to run the command :

gulp


I got the above mentioned error ,So I thought the problem because I didn't add the file name to the command :

gulp gulpfile.js 


 but that also didn't solve the issue. again and again I check the file for syntax errors but didn't find thing.

The problem as very dummy . It is because I didn't add the task name to the command line :

gulp  minify-css



That's it . thank you.


Wednesday, January 29, 2014

Call to undefined method Illuminate\Foundation\Providers\ArtisanServiceProvider::when()

This error showed when trying to upgrade to Laravel 4.1, Also  when trying to  update composer , the first Solution to this problem is to change all your composer.json file (assumed that you have some in workbench folder), to be compatible with new versions of laravel :

Change this line in Composer.json :

"illuminate/support": "4.1.*" 

to be Like this


 "illuminate/support": "4.*" 

Then Run :

 Composer update --no-scripts  

In the main folder that contain composer.json And also on all the main folders of your packages .

Saturday, November 23, 2013

laravel pdo load data infile only imports first row."This command is not supported in the prepared statement protocol yet"

"This command is not supported in the prepared statement protocol yet". When I tried to use "load data infile" as a raw query on a table , It failed with this error , and after playing with many parameters in the query and tried many DB methods like DB::raw,DB::statement and DB::select, but nothing change the problem still exist . finally I can run the query but only the first raw was inserted,so The problem is in the query itself and Mysql server cannot under the end of line symbol , Just adding double back slash will solve this issue.
"LOAD DATA LOCAL INFILE 'filename'

                    INTO TABLE `tablename`

                    FIELDS TERMINATED BY ','

                    LINES TERMINATED BY '\\n'

                    (col1,col2,col3)";

Thursday, November 21, 2013

laravel 4 Cannot modify header information - headers already sent by (output started at

This error happened when you are using one of these statements in laravel 4 application :

 Redirect::to or  header('Location: ' . $url) 

Where your Laravel 4 application had sent a header to the screen before you decide to redirect the browser to other url . Sometimes this error caused by echo statement before the redirection , other output text or white space, But in my case the error because I have added a php closed tag:

?>  

in the end of the included files. So removing  this tag will bring the application back to normal behavior.

Tuesday, November 12, 2013

User is not returning back after been sent to oauth/authenticate on twitter api 1.1

When you trying to connect with twitter api 1.1 to authenticate a user , some time the twitter Authentication page will not come back to the callback function And you are very sure that the required parameters are valid and set .The first thing you should do is trying the code with another new client (Screen name), a client that was never subscribed to the application. if the new client can authenticate and return back to the application then the Problem is in the Permission levels of your application with twitter api, and to solve this issue then, every subscribed user should revoke the application and subscribe to it again.

Sunday, November 10, 2013

ie html contditional tage is not responding when using ie conditions

If you have a problem that ie tag is not working and the css file that you assign for this tag is not loading then the problem may be as I found it in the tag spaces. there must be no space in the tag before "If" and after ie9 .like what you see here :

<!--[if lt IE9]>
    <link rel="stylesheet" type="text/css" href="/assets/css/ie.css" />
<![endif]-->


 that mistake can happened if it like the following:

<!--  [if lt IE9]> or <!--[if lt IE 9]> or  <!--[if lt IE 9]  > 

also

<!  [endif]-->  or <![endif]  --> 
 
 
Note: Microsoft Stopped supporting IE condition tag in IE-10 and later Versions