Saturday, March 29, 2014

pg_ctl.exe error code 1057 on windows 7 -- PostgreSQL create user create password

The Problem is : Postgres is running on Wamp but cannot connect to database because the username is not set, or the rule is not set. So when trying to  run pg_ctl.exe  with -U option to change the username I got this error .

pg_ctl.exe error code 1057 
 
This is a windows error code :

Error code 1057: ERROR_INVALID_SERVICE_ACCOUNT - The account name is invalid or does not exist.

That means the account name or the username that was used with this command is invalid , and that because (in my case) I didn't create user , to do so :

go to the PostgreSQL bin folder and run this command :

createuser  --password postgres

you will be prompted by password enter

password:

Enter the password related to the account with username (postgres).

Now you have created a username `postgres` with  a password , a credentials that you can use to login to PostgreSQL server.

Sunday, March 16, 2014

in Wamp PHP Startup: Unable to load dynamic library c:\php\

If you are using Wamp server, and when you try to switch between php versions or trying to swirch between Apache versions and you get an error message saying that Php cannot load the dynamic library that you know it is exist in the extensions folder. and the stupid wamp server  looking for that extension in a place other than the one mentioned in phpForApache.ini file.
The Problem here is that php-win.exe running without depending on apache server, So php will use the php.ini file that reside in php folder not the one that reside in Apache folder .
Because I didn't change this file (the one in php folder) and used to deal with phpForApache.ini because it is the one that will be copied to Apache folder .
To solve this issue just make the two files identical , that means when you make any changes to one of the be assure that you make these vhanges in the other one.

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.