PHP Classes

Installation

Recommend this page to a friend!

      NAJAX  >  All threads  >  Installation  >  (Un) Subscribe thread alerts  
Subject:Installation
Summary:NAJAX doesn't work
Messages:4
Author:Peter Stöcker
Date:2005-10-11 09:40:38
Update:2005-10-13 07:48:58
 

  1. Installation   Reply   Report abuse  
Picture of Peter Stöcker Peter Stöcker - 2005-10-11 09:40:38
Hi out there!

I have some problems with using NAJAX!

I extracted the archive to C:\apache\php\najax-0.4.1.0\ and added this dir to php.ini.

Now I created in htdocs a dir najaxtest to test the basic application from the tutorial ("Hello World"). But it doesn't work at all.

I also tried it with the calculator example from the archive. No chance. I changed in index.php require_once('../../najax.php'); to require_once('najax.php'); otherwise I got a fatal error. But that doesn't help either.

I also tried another way and copied the dir from C:\apache\php\najax-0.4.1.0\ to C:\apache\htdocs\najaxtest\najax-0.4.1.0\. It's the same with the Hello-World-example. BUT the examples at C:\apache\htdocs\najaxtest\najax-0.4.1.0\examples\ work now.
So I copied the Hello-World-example to C:\apache\htdocs\najaxtest\najax-0.4.1.0\examples\test and changed the require_once path. It doesn't work.

I don't understand what's the problem.

Can anyone help me?

Thanks,
pest

  2. Re: Installation   Reply   Report abuse  
Picture of Peter Stöcker Peter Stöcker - 2005-10-11 11:29:20 - In reply to message 1 from Peter Stöcker
Hi!

I solved the problem!

1. Najax has to be in the htdocs dir (e.g. htdocs\najaxtest\najax-0.4.1.0)
2. It's enough to write require_once('najax.php');
3. For header you have to point to the sub dir
<?= NAJAX_Utilities::header('najax-0.4.1.0'); ?>

That made it work.

But I have to mention, that it would be better to have NAJAX in a dir out of htdocs, like c:\apache\php\najax-0.4.1.0. Perhaps in another version.


Bye,
Pest

  3. Re: Installation   Reply   Report abuse  
Picture of Stanimir Angeloff Stanimir Angeloff - 2005-10-13 07:46:35 - In reply to message 2 from Peter Stöcker
Hi,

It's possible to move NAJAX to a directory that is outside 'htdocs'. Just copy the 'js' folder in 'htdocs'. Try this script:

<?php

class Example
{
function invoke()
{
return "OK";
}
}

define('XOAD_AUTOHANDLE', true);

require_once('D:/Temp/xoad/xoad.php');

?>
<?= XOAD_Utilities::header() . "\n" ?>
<script type="text/javascript">

var obj = <?= XOAD_Client::register(new Example()) ?>;

alert(obj.invoke());

</script>

  4. Re: Installation   Reply   Report abuse  
Picture of Stanimir Angeloff Stanimir Angeloff - 2005-10-13 07:48:58 - In reply to message 3 from Stanimir Angeloff
BTW, XOAD is the new name for NAJAX. I'll release it tomorrow (October 14th).