gosmore.php failing on Ubuntu 11.04

Hello,

When I run the gosmore.php from firefox browser here is the error log.
[Mon Sep 05 14:36:16 2011] [error] [client 192.168.5.102] PHP Notice: Undefined index: HTTP_X_YOURS_CLIENT in /var/www/yours/api/1.0/gosmore.php on line 21
[Mon Sep 05 14:36:16 2011] [error] [client 192.168.5.102] PHP Notice: Undefined index: HTTP_REFERER in /var/www/yours/api/1.0/gosmore.php on line 22
[Mon Sep 05 14:36:16 2011] [error] [client 192.168.5.102] PHP Warning: fopen(/var/www/yours/commands.log): failed to open stream: Permission denied in /var/www/yours/api/1.0/gosmore.php on line 158
[Mon Sep 05 14:36:16 2011] [error] [client 192.168.5.102] PHP Warning: chdir(): No such file or directory (errno 2) in /var/www/yours/api/1.0/gosmore.php on line 164
nice: ./gosmore: No such file or directory
[Mon Sep 05 14:36:16 2011] [error] [client 192.168.5.102] PHP Warning: fopen(/var/www/yours/requests.csv): failed to open stream: Permission denied in /var/www/yours/api/1.0/gosmore.php on line 255
[Mon Sep 05 14:36:16 2011] [error] [client 192.168.5.102] PHP Warning: fopen(/var/www/yours/requests.csv): failed to open stream: Permission denied in /var/www/yours/api/1.0/gosmore.php on line 262

and on web page
An unexpected error occured in Gosmore:

Here is what I have done:

  1. Installed apache with php 5 and tested by putting
  2. Installed gosmore package
  3. Downloaded india.pak, unzipped and renamed to NN…pak and copied into /usr/local/gosmore and /usr/local/share/gosmore directories. BTW, I have installed gosmore in /usr/local/gosmore directory
  4. downloaded yours pages into /var/www
  5. Went into /var/www/yours/api/dev/gosmore.php and updated $www with /var/www/yours and $yorus with /usr/local/gosmore
  6. Restarted apache server
  7. php request: http://192.168.5.104/yours//api/dev/gosmore.php?format=kml&flat=12.9589756&flon=77.5772524&tlat=12.9839423&tlon=77.5801277&v=motorcar&fast=1&layer=mapnik

Please let me if I have missed something in the installation process or configuration.

thanks,
Tiru

The php notices and warnings are mostly PHP and access rights configuration problems, but they don’t stand in the way of a working system. You may choose to disable the offending lines of code, it won’t break anything critical.

The real problem is that Gosmore is not found in the directory in which it is expected:

[Mon Sep 05 14:36:16 2011] [error] [client 192.168.5.102] PHP Warning:  chdir(): No such file or directory (errno 2) in /var/www/yours/api/1.0/gosmore.php on line 164
nice: ./gosmore: No such file or directory

So please investigate line 164 more closely, the variable provided to chdir() is probably not correct.