Unsupported Screen Size: The viewport size is too small for the theme to render properly.

sja and php

forums forums sja and php

  • This topic is empty.
Viewing 26 reply threads
  • Author
    Posts
    • #8445
      stroperyliad
      Member

      Hello to everybody,

      i am using sja with linux (redhat 9.0), php 4.3.4 and mysql 4.

      I am using sja from command line and it syncs 2 tables on several mysql servers. No problem, everthing is working fine.

      Now i have written a small web application with php, where you can push a button to sycn the tables, but it doesn't work. Here is a short snapshot :

      exec($SJAPATH.”sja “.$JOBNAME.” -l”.$SJALOGPATH.$JOBNAME.”.log >> $SJALOGPATH.$JOBNAME.”.out”);

      The log and out files are created, but the size is 0 and there is no snyc! 😕

      ________________________________________________________________________________

      After spending some more minutes on this problem, i got this error message in the out file:

      SQLyog Job Agent Version 2.0

      Copyright © Webyog. All Rights Reserved.

      Error opening session ERROR log file.

      ________________________________________________________________________________

      😛 Found the solution: this error only occures only with sja2.0 😡 , the old version sja1.1 works perfect 😀

    • #15824
      wiL
      Member

      I'm getting the same error with:

      SQLyog Job Agent Version 4.1

      Where can I download a different version of this?

    • #15825
      peterlaursen
      Participant

      QUOTE
      exec($SJAPATH.”sja “.$JOBNAME.” -l”.$SJALOGPATH.$JOBNAME.”.log >> $SJALOGPATH.$JOBNAME.”.out”);

      I am not a coder but are all those punctuations correct? And is there not a ” missing after “log” ? I would propose:

      QUOTE
      exec($SJAPATH.”sja “$JOBNAME” -l”$SJALOGPATH.$JOBNAME”.log” >> $SJALOGPATH.$JOBNAME.”out”);

      And why dublicate the log-file to an out-file. Just

      QUOTE
      exec($SJAPATH.”sja “$JOBNAME” -l”$SJALOGPATH.$JOBNAME”.log”);

      Apologize for my interference in this. But I take a chance to learn something too!

      There are bugs in version 1 so if there is a problem with version 2 it should be fixed.

    • #15826
      wiL
      Member

      “Error opening session ERROR log file. ” is the error I get when use PHP to exec('sja') the SJA file.

      Can we omit the Error log file or just make it work in PHP? What seesion does it need to open? I made sure that the permission are all 777 and it still doesn't work.

      I've double and tirple check the path and still no luck.

    • #15827
      peterlaursen
      Participant

      QUOTE
      “Error opening session ERROR log file. ” is the error I get when use PHP to exec('sja') the SJA file.

      Yes but if there are two many .(punctuations) and a ” (double-quote) missing the generated string may not be valid!

    • #15828
      wiL
      Member

      I used this version to output the error.

      exec('sja '.DOMAIN_CONFIGURATIONS_PATH.'database_sync.xml -l'.DOMAIN_CONFIGURATIONS_PATH.'sja.log');

      and i still get the same problem.

    • #15829
      peterlaursen
      Participant

      QUOTE
      exec('sja '.DOMAIN_CONFIGURATIONS_PATH.'database_sync.xml -l'.DOMAIN_CONFIGURATIONS_PATH.'sja.log');

      Since you use the default log file name you could try too to omit the -l -parameter

      QUOTE
      exec('sja '.DOMAIN_CONFIGURATIONS_PATH.'database_sync.xml';

      is it correct php syntax that the

      QUOTE
      .DOMAIN_CONFIGURATIONS_PATH

      must start with a punctuation? I just ask 😉

      This works with windows SJA on my own php installation:

      CODE
      Sync succesfull

      “;

      ?>

      to simplify things I copied sja.exe to the webroot of my local Apache with the test.php and test.xml-files. Data are sync'ed and the peter.log is created.

      You are welcome to try here:

      http://deepeter.dyndns.dk/test.php

      .. you wont see the data .. but I can paste in the log!

      I believe you simply should write correct syntax so that the system can resolve the path. I apologize if I am wrong – I dont have a *nix at the moment 😮

    • #15830
      wiL
      Member

      This is somewhat similar to what I actually have when the PHP Constants have been converted to actual strings.

      CODE
      sja /home/httpd/vhosts/domain.com/httpdocs/_configurations/database_sync.xml -l/home/httpd/vhosts/domain.com/_configurations/sja.log

      permissions for

      /home/httpd/vhosts/domain.com/_configurations/

      /home/httpd/vhosts/domain.com/_configurations/sja.log

      are 777

      I have no idea what else to do… I'm just happy some SJA works with PHP unlike Unison (file sync)

      Thing is that this works on the command line no problem but when PHP tries to do it then it starts giving me error log errors.

      BTW. Its on a Linux machine too

      Exact Error Message

      QUOTE
      SQLyog Job Agent Version 4.1 Copyright © Webyog Softworks Pvt. Ltd.. All Rights Reserved. Error opening session ERROR log file.

    • #15831
      peterlaursen
      Participant

      I can see that I had a visit. You probably!

      QUOTE
      Sync started at Fri Sep 30 02:30:34 2005

      I shall not say more! A php/vhost configuration issue?

      I know nothing about it.

      But nice if someone with a local *nix would try to repeat the simple exercise SJA for Linux that I did with SJA for Windows.

      Undoubtedly Ritesh or sombody else at Webyog will look into it tomorrow. Or later today actually. It is 6 am in Bangalore! Get up guys! There is work for you! 😀

    • #15832
      wiL
      Member

      HEHE…

      Thanks Peter!!!

      I really really appreciate the tests you have made.

      Yep it was me who visited 😀

      I'm so eager to have this working. Its the one piece of the puzzle that I am missing before the bulk of my application is complete and I can start working on other areas like user interface design.

      Thanks Again!

    • #15833
      peterlaursen
      Participant

      php configuration:

      I checked my own php-ini (in the moment 5.1 RC, but I guess this is the same with all versions). This setting looks interesting:

      ; open_basedir, if set, limits all file operations to the defined directory

      ; and below. This directive makes most sense if used in a per-directory

      ; or per-virtualhost web server configuration file. This directive is

      ; *NOT* affected by whether Safe Mode is turned On or Off.

      ;open_basedir =

      Maybe you should check that! Or let the Sys Admin do so.

    • #15834
      wiL
      Member

      got that all checked out..

      I'm actually executing TAR and FTPSYNC programs from the same directory and it works just fine… But it doesn't work with PHP.

      I wonder if there's any other tests i can do.

    • #15835
      wiL
      Member

      Follow Up

      CODE:

      CODE
      sja database_sync.xml -lsja.log 2>&1

      RESPONSE:

      QUOTE
      SQLyog Job Agent Version 4.1 Copyright © Webyog Softworks Pvt. Ltd.. All Rights Reserved.

      Error opening session ERROR log file.

      Everything is 777.

      http://admin.blendermedia.com/staging/test…ations/test.php

    • #15836
      peterlaursen
      Participant

      One thing more: Where is the SJA executable located relative to where the php, xml and log files are?

      I had some problems with writing log somewhere not in the tree below SJA using absolute adressing.

      But succeded with relative adressing like

      CODE
      exec('sja test.xml -l..logpeter.log');

      SJA executable, test.php and test.xml is in webroot/test

      I write log to webroot/log

      .. is like HTML: means one folder up in tree.

      And …… means three folder up in tree.

      On Linux you proably must use / not .

    • #15837
      peterlaursen
      Participant

      QUOTE
      I'm actually executing TAR and FTPSYNC programs from the same directory and it works just fine… But it doesn't work with PHP.

      yes but the php-configuration of course has no effect on code that is not php!

    • #15838
      peterlaursen
      Participant

      and BTW. If logfile is written to same directory as the SJA executable you simply don't need to specify any path at all.

      I created a webroot/test directory and put SJA and the php- and xml-file there.

      Php code looks still like my first example and this

      http://deepeter.dyndns.dk/test/test.php

      writes the peter.log to webroot/test .

      I suggest you try this to be 100% sure that it is not a problem with php parsing/resolving the path. If it still don't work it must be a server/php configuration issue.

      My best guess is that

      CODE
      sja /home/httpd/vhosts/domain.com/httpdocs/_configurations/database_sync.xml -l/home/httpd/vhosts/domain.com/_configurations/sja.log

      does not work, because being a webserver plugin php has its root in /httpdocs .

      maybe

      CODE
      sja /_configurations/database_sync.xml -l/_configurations/sja.log

      would work as an absolute adressing. I guess so actually (just checked with a website with the same vhost's structure that I can access with ftp. But no chance for me to execute code there. I would be quite unpopular if something went wrong!)

    • #15839
      Ritesh
      Member

      SJA takes two parameters as suggested in the docs:

      CODE
      sja jobfile -llogfile

      Note: there is no space between -l and the logfile. If you dont specify -l, then SJA will create sja.log in the same folder from where SJA is executed.

      Other then sja.log, SJA also creates sjasession.xml which has error written in XML format. You cannot specify the path for this file and it will always open up in the same folder as SJA. This basically requires that the path of SJA has write permission otherwise SJA wont be able to create the sjasession.xml and hence it will stop after throwing up the error:

      Error opening session ERROR log file.

      We acknowledge that this is a bad design and we plan to fix it in 4.2 BETA 4. v4.2 BETA 3 will be released today and we dont want to change the code so late in the release. You can expect BETA 4 anytime next week 🙂

    • #15840
      Ritesh
      Member

      QUOTE(stroperyliad @ May 21 2004, 04:13 PM)
      Found the solution: this error only occures only with sja2.0  😡 , the old version sja1.1 works perfect 😀

      [snapback]3030[/snapback]

      This is due to the fact that sjasession.xml implementation was done in v2.0 and thus its failing!

    • #15841
      wiL
      Member

      For TAR and FTPSYNC.

      Sorry I meant that i have PHP excecuting those programs.

      CODE
      exec('tar -xvzf file.tar.gz')

      exec('ftpsync db.cnf')

      and they both work fine and not php errors or permissions problems.

    • #15842
      wiL
      Member

      Where can we download the latest version? 😀

      Cheers,

      wiL

    • #15843
      Ritesh
      Member

      Its not out yet. It will take another 3-4 days 🙂

    • #15844
      wiL
      Member

      Any updates yet? 😀

    • #15845
      Ritesh
      Member

      Nope.

      We are working on some issues regarding log and session file.

      I will post in this thread once we release SJA with a fix.

    • #15846
      wiL
      Member

      Any Update?

      LOL I have a project eager to finish and its the last component 😀

      How's the project going along?

    • #15847
      Ritesh
      Member

      It going along nice. You can expect a release next week 😀

    • #15848
      wiL
      Member

      Just following up. 😀

      “Is it ready yet?”

      How long to go so I can plan…

      🙂

    • #15849
      Ritesh
      Member

      You can download SJA v4.2 RC1 from:

      http://www.webyog.com/betas/sja42.tar.gz

      Starting with this version, you can specify the path for session.xml file.

      Now you can execute SJA like:

      CODE
      sja -llog.log -ssession.xml schema.xml

Viewing 26 reply threads
  • You must be logged in to reply to this topic.