Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

Setup problem blank...
 
Notifications
Clear all

Setup problem blank database.

15 Posts
3 Users
0 Reactions
20.5 K Views
(@jaynarol)
Posts: 8
Active Member
Topic starter
 
[#1040]

I encountered a problem during install.

1. i input parameter on first page and submit.
2. out put "Database 'projectorria' created. Parameters are saved.".
3. web redirect to /view/main.php.
4. blank page...

I tried to fix it but without success.

I encountered the following problem.
1. database create success but not have any table.
2. in php logs i found..

[Sat Mar 23 18:46:48.816944 2013] [:error] [pid 5668:tid 1044] [client 127.0.0.1:27819] PHP Fatal error:  Call to a member function query() on a non-object in D:\Web\web.com\pmi\model\persistence\Sql.php on line 58, referer: ...
[Sat Mar 23 18:46:48.816944 2013] [:error] [pid 5668:tid 1044] [client 127.0.0.1:27819] PHP Stack trace:, referer: ...
[Sat Mar 23 18:46:48.816944 2013] [:error] [pid 5668:tid 1044] [client 127.0.0.1:27819] PHP   1. {main}() D:\Web\web.com\pmi\view\main.php:0, referer: ...
[Sat Mar 23 18:46:48.816944 2013] [:error] [pid 5668:tid 1044] [client 127.0.0.1:27819] PHP   2. require_once() D:\Web\web.com\pmi\view\main.php:10, referer: ...
[Sat Mar 23 18:46:48.816944 2013] [:error] [pid 5668:tid 1044] [client 127.0.0.1:27819] PHP   3. include() D:\Web\web.com\pmi\tool\projector.php:121, referer: ...
[Sat Mar 23 18:46:48.816944 2013] [:error] [pid 5668:tid 1044] [client 127.0.0.1:27819] PHP   4. Parameter::getGlobalParameter() D:\Web\web.com\pmi\view\login.php:24, referer: ...
[Sat Mar 23 18:46:48.816944 2013] [:error] [pid 5668:tid 1044] [client 127.0.0.1:27819] PHP   5. SqlElement->getSqlElementsFromCriteria() D:\Web\web.com\pmi\model\Parameter.php:471, referer: ...
[Sat Mar 23 18:46:48.816944 2013] [:error] [pid 5668:tid 1044] [client 127.0.0.1:27819] PHP   6. Sql::query() D:\Web\web.com\pmi\model\persistence\SqlElement.php:1163, referer: ...

please help me.

thank!


 
Posted : 23 Mar 2013 15H13
(@babynus)
Posts: 14952
Member Admin
 

First, it is normal that database is empty.
It will be updated on first connection.

Then the issue you get.
Your log reports an issue on line 1163 of /model/persistence/SqlElement.php.
Line code is code type=php] $result = Sql::query($query);

There is not reason to get an error there.
Sql is a class, and query is called as a static method.

Which version of PHP do you run ?


 
Posted : 23 Mar 2013 15H33
(@jaynarol)
Posts: 8
Active Member
Topic starter
 

Thank for Reply :cheer: .

MyServer:
php - 5.4.11
apache - 2.4.3 (Win32)
mysql - 5.6.10


 
Posted : 23 Mar 2013 15H36
(@jaynarol)
Posts: 8
Active Member
Topic starter
 

it is error in "model/persistence/Sql.php" on line 58

56    try { 
57    	$startMicroTime=microtime(true);
58      $result = $cnx->query($sqlRequest);
59      if (isset($debugQuery) and $debugQuery) {
60      	// debugLog to keep
61        debugLog(round((microtime(true) - $startMicroTime)*1000000)/1000000 . ";" . $sqlRequest);
62      }

i install projectorriaV3.2.1.


 
Posted : 23 Mar 2013 15H45
(@babynus)
Posts: 14952
Member Admin
 

Do you have PDO installed ?


 
Posted : 23 Mar 2013 15H51
(@jaynarol)
Posts: 8
Active Member
Topic starter
 

yes. I install already.

in my php.ini

extension=php_pdo_mysql.dll

Is it possible that the version of php or apache not Incongruous?


 
Posted : 23 Mar 2013 15H57
(@babynus)
Posts: 14952
Member Admin
 

It looks like you cannot get a connection.

Can you add a var_dump for connection on Sql.php, line 244. It should look like :

 try {
    	$dsn = self::$dbType.':host='.self::$dbHost.';dbname='.self::$dbName; 	    
    	self::$connexion = new PDO($dsn, self::$dbUser, self::$dbPassword);
var_dump(self::$connexion);
    	self::$connexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    }
    catch (PDOException $e) {
    	echo htmlGetErrorMessage($e->getMessage( )).'
'; }

and report here displayed content.


 
Posted : 23 Mar 2013 17H45
(@jaynarol)
Posts: 8
Active Member
Topic starter
 

I think it error before var_dump().

This is a Full HTML code in page.




  
  Project'Or RIA
  
  
  
  
  
  <script type="text/javascript" src="../external/dojo/dojo.js"
    djConfig='modulePaths: {i18n: "../../tool/i18n"},
              parseOnLoad: true, 
              isDebug: SQLSTATE[HY000] [2002] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.


( ! ) Fatal error: Call to a member function query() on a non-object in D:Webweb.compmimodelpersistenceSql.php on line 58
Call Stack
#TimeMemoryFunctionLocation
10.0016397824{main}( )..main.php:0
20.0047664264require_once( 'D:Webweb.compmitoolprojector.php' )..main.php:10
30.02801679096include( 'D:Webweb.compmiviewlogin.php' )..projector.php:121
40.02861679408Parameter::getGlobalParameter( )..login.php:24
50.02871681048SqlElement->getSqlElementsFromCriteria( )..Parameter.php:471
60.02961739592Sql::query( )..SqlElement.php:1163

 
Posted : 23 Mar 2013 17H56
(@jaynarol)
Posts: 8
Active Member
Topic starter
 

OK i can FIX it! :woohoo:

Insert Port in to Line 219

217    if (!self::$dbType or !self::$dbHost or !self::$dbName) {
218      self::$dbType=Parameter::getGlobalParameter('paramDbType');
219      self::$dbHost=Parameter::getGlobalParameter('paramDbHost').':'.Parameter::getGlobalParameter('paramDbPort');
220      self::$dbUser=Parameter::getGlobalParameter('paramDbUser');
221      self::$dbPassword=Parameter::getGlobalParameter('paramDbPassword');
222      self::$dbName=Parameter::getGlobalParameter('paramDbName');     
223    }

Thank you so much 😆


 
Posted : 23 Mar 2013 18H11
(@babynus)
Posts: 14952
Member Admin
 

You're right !

Code only worked for default port (3306).
I'll include this fix in next version.

Thanks for your contribution.


 
Posted : 23 Mar 2013 18H35
(@pfernandez)
Posts: 5
Active Member
 

Hi,

Your patch doesn't work.
The DSN is not corretly set.
I suggest :

class Sql {
[...]
  private static $dbPort;
[...]
  private static function getConnection() {
[...]
      if (isset($paramDbPort) and $paramDbPort) { self::$dbPort = $paramDbPort; }
[...]
        $dsn = self::$dbType.':host='.self::$dbHost.';port='.self::$dbPort.';dbname='.self::$dbName;
[...]

 
Posted : 28 Mar 2013 17H19
(@babynus)
Posts: 14952
Member Admin
 

It is this syntax for DSN that is implement in V3.2.2.
Did you test it ?


 
Posted : 28 Mar 2013 17H36
(@pfernandez)
Posts: 5
Active Member
 

Yes, in 3.2.2, the code is :

    220       if (isset($paramDbPort) and $paramDbPort) { self::$dbHost.=':'.$paramDbPort; }

    244         $dsn = self::$dbType.':host='.self::$dbHost.';dbname='.self::$dbName;

DSN must be : type:host=xxx;port=xxx;dbname=xxx
If you chained the host and port with ":" it doesn't work.


 
Posted : 29 Mar 2013 14H23
(@babynus)
Posts: 14952
Member Admin
 

It seems you downloaded V3.2.2 in the first hours of monday 25th.

There is a message in the news about this point : due to deployment issue, pleased re-dwnload V3.2.2 if you first downloaded it on monday 25th before 3 PM GMT.

Correct version sets :

   try {
    	$dsn = self::$dbType.':host='.self::$dbHost.';port='.self::$dbPort.';dbname='.self::$dbName; 	  
    	self::$connexion = new PDO($dsn, self::$dbUser, self::$dbPassword);
    	self::$connexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    }

 
Posted : 29 Mar 2013 18H28
(@pfernandez)
Posts: 5
Active Member
 

Exact ! 😛
Problem solved 😉


 
Posted : 02 Apr 2013 16H55
Share:

Scroll to Top