Tuesday, December 15, 2015

Install Opengts on Tomcat

to Install opengts on windows do the following:

on opengts folder run : > ant
then > ant track
then > ant track deploy

the application will be deployed on tomcat

Tuesday, October 13, 2015

LOAD DATA LOCAL INFILE Not Working

This is an Error that I made many times and cannot remember how to fix it, which in turn cost a lot of googling time.
The problem laid in the difference between Unix an Windows ....... Dont use "\r" when you are on windows Machine



LOAD DATA LOCAL INFILE 'd:/www/text.csv' INTO TABLE table
FIELDS TERMINATED BY ','
LINES TERMINATED BY "\n"
IGNORE 1 LINES

Please check connection uri string and try again red5 windows 7

JAVA_HOME environment variable not set! Take a look at the readme.
Press any key to continue . . .

When you see this error message ,That means your java directory is not set as a variable in the system Variables , to do so :
1. Go to control panel --> then to System and Security --> then to System
2. On the Left Panel click on Advanced System Settings.(New window will popup).
3.In the new Popped up window click on (Advanced) tab on the top then click "Environment Variables" at the bottom.(New window will popup).
4. in the new popped window under the lower table box click on NEW.
5. Enter the Variable Name as JAVA_HOME.
6.Enter  the Variable Value as C:\Progra~1\Java\jre7.

Thursday, September 17, 2015

SQLSTATE[08006] [7] invalid connection option "adapter" Postgresql on Phalcon

In phalcon php framework, When you try to connect to PostgreSQL Database using configuration variables in config., you may write it as follows:
 
return new \Phalcon\Config(array(
    'database' => array(
        'adapter'     => 'Postgresql',
        'host'        => 'localhost',
        'username'    => 'postgres',
        'password'    => 'root',
        'dbname'      => 'mydb',
        'charset'     => 'utf8',
    ),....
 
 
if that is the case, you will get an error saying : invalid connection option "adapter" The problem here is that PostgreSQL configuration doesn't need the adapter key in the configuration array, also the charset key will produce the same error, So remove the two keys from the configuartion array:
  
return new \Phalcon\Config(array(
    'database' => array( ,
        'host'        => 'localhost',
        'username'    => 'postgres',
        'password'    => 'root',
        'dbname'      => 'mydb',
    ),....
 
 
The Second thing to do to assure that the database is connected, check to the services.php file and change the adapter to use postgresql instead of whatever been there (usually MySQL).
 
use Phalcon\Db\Adapter\Pdo\Postgresql as DbAdapter; 

Wednesday, August 12, 2015

php_curl not loading on wamp windows -- PHP Warning: PHP Startup: Unable to load dynamic library /ext/php_curl.dll' - The application has failed

php_curl.dll is not loading on apache 2.4.*  running on wmap , what is the problem :

1- first of all,  all php extensions must be uncommitted in php.ini file by removing the semicolon from the front of the extension.


change this line :

 ;extension = php_curl.dll  

to

 extension = php_curl.dll    >


And restart your apache server again. if this step was not enough and the curl extension is not loaded then try the next step.

2.check you are loading the right php.ini , some times you have many php versions and you think you are working on the right one but you are not.

3 - on wamp, Apache loading the php.ini file that is located in apache version directory:

c:/wamp/bin/apache/apcheVersion/bin/
4.in the php.ini file check the extension_dir parameter, if it has the right path to the extensions directory :
; On windows:
; extension_dir = "ext"
extension_dir = "c:/wamp/bin/php/php5.5.14/ext/"
5. check the VC version of the apache server and the VC of the extension php_curl or your php version,that means : did they have been compiled using the same VC version : 

VC is  Visual C++ redistributable package 

You can find these version on the download page for php and for apache.see the images below:



To solve this problem  you have to download the same version for both php extension and Apache server. 

6. the last and the important one which always happened to be the problem, is the php path in the system envronments.
 php_curl uses the system resources to connect and relay on two important files libeay32.dll and ssleay32.dll and these two file must have the same VC version as php_curl.dll, and must located in a path that is reachable by php_curl.dll >

Let me  explain this point : 

If your system environment path has the php version that is not the one you are running then php_curl will not be loaded , because php_curl will ask the system to support him by these files and the system knows only the php version which is declared in the system environment path variable. So the system will load the wrong files.

To solve this problem : 

 When you need to use php_curl.dll in your project , then work only with the php version that is declared in the system environment path variable, so php_curl will get the right support from these files that have the same VC version as the php_curl.dll.

Thursday, June 4, 2015

Namespace declaration statement has to be the very first statement in the script

Check if there is any hidden character before the namespace keyword  , if you are using notepad++  convert your document to "utf8 without BOM character".
Also check that there is no character came before <?php tag