logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: Upgraded my WAMP now PHP code won't run correctly
Author
eatc7402



Joined: 03 Jun 2013
Posts: 6
Location: Philippines, Davao

PostPosted: Mon 03 Jun '13 12:22    Post subject: Upgraded my WAMP now PHP code won't run correctly Reply with quote

My production server runs...
Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8j FrontPage/5.0.2.2635 mod_jk/1.2.27
mod_fastcgi/2.4.6 PHP/5.3.5 mod_perl/2.0.4 Perl/v5.8.8
MySQL client version: 5.1.3

Everything works fine there.

I JUST upgraded my LOCAL WAMP to...
Apache/2.2.22 (Win32) PHP/5.3.13
MySql 5.5.24

There on my localhost (where things were fine before upgrade) my php, and mysql rin fine, and some tests prove that to be the case. However have mnt pages the
use the third party php library GoogeMaps 3.0, which functioned perfectly before the upgade

Now any time code requires OUTPUT from the GoogleMaps
all I get is..
getHeaderJS();?> getMapJS();?> printOnLoad();?>
instead of correct output.

I have made NO other changes except the upgrade.
Where have I gone wrong? Or where have I neglected
to correctly configure Apache?

eatc7402
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 03 Jun '13 13:56    Post subject: Reply with quote

it is short_open_tag in your php.ini

See
http://www.php.net/manual/en/ini.core.php#ini.short-open-tag
Back to top
eatc7402



Joined: 03 Jun 2013
Posts: 6
Location: Philippines, Davao

PostPosted: Tue 04 Jun '13 1:45    Post subject: Reply with quote

Well yes the short open tag in php.ini was set OFF. I changed it back to on and that fixed the 'regular' php
code.

But anything using code from the GoogleMaps 3.0 API still
is NOT working.

eatc7402
Back to top
eatc7402



Joined: 03 Jun 2013
Posts: 6
Location: Philippines, Davao

PostPosted: Tue 04 Jun '13 2:25    Post subject: Reply with quote

Here's an example of how my code looks n the production
server, and it's correct.
http://www.extraalarm.org/mult_alarm_data/mpls/mpls_extra_alarms_2012_make_v3map.php

In my localhost none of the 'placemarks' that should be on the map, and the information on the maps right sidebar.

All the missing info is generated dynamically in javascript from the GoogleMaps 3.0 API code.

eatc7402
Back to top
eatc7402



Joined: 03 Jun 2013
Posts: 6
Location: Philippines, Davao

PostPosted: Tue 04 Jun '13 6:09    Post subject: Reply with quote

I've done more investigation regarding the mysql data my
WAMP was using. I had reloaded a former mysql data backup into my new mysql installation, and from the wiews
in PhpMyAdmin it okay, however queries returned some 'strange' (wrong values) data.

So I made a backup of my productin server mysql database, and then imported THAT data.

ALMOST everything returned to normal on my localhost.

EXCEPT for the following..
On production I have this line of php...
Code:
$two_two_icon = "http://www.extraalarm.org/mult_alarm_data/graphics/2-2_alarm.png" ;


But on my localhost I have this ...
Code:
$host= gethostname();
$my_ip = gethostbyname(trim($host));
$two_two_icon = "http://$my_ip/mult_alarm_data/graphics/2-2_alarm.png" ;


When I run the second (localhost) example I now
get the following error...
GoogleMapAPI:createMarkerIcon: Error reading image: http://192.168.254.104/mult_alarm_data/graphics/2-2_alarm.png

Which indicated it could'nt access the local .png file.
This formerly worked fine in my previous WAMP install.
The local IP address is correct.

What I don't know if this happening because of a misconfiguration which won't allow 'external' images
to be loaded... or what?

If I load the needed .png files from an EXTERNAL
server, it works, but is verrrrry slow. Hence the need
to load it locally. However the GoogleMaps 3.0 API
does nor allow $some_icon= xyz.png. It must be
$some_icon = "http://$my_ip/xyz.png" ; for a 'fake'
remote load.

This being fixed will return me to 'normal', as in
BEFORE my new WAMP.

eatc7402
Back to top
eatc7402



Joined: 03 Jun 2013
Posts: 6
Location: Philippines, Davao

PostPosted: Tue 04 Jun '13 7:37    Post subject: Reply with quote

If I paste the following url containing my local
IP in my browser...

http://192.168.254.104/mult_alarm_data/graphics/2-2_alarm.png

I get the following error...
"Forbidden
You don't have permission to access /mult_alarm_data/graphics/2-2_alarm.png on this server."

This is what I mean when I say I don't have access to this .png image from my localhost.

Accessing from my production server works fine. Only local access has an issue.

eatc7402
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Tue 04 Jun '13 11:40    Post subject: Reply with quote

Well the 403 is related to the config of your apache (permissions).
Back to top
eatc7402



Joined: 03 Jun 2013
Posts: 6
Location: Philippines, Davao

PostPosted: Tue 04 Jun '13 12:14    Post subject: Reply with quote

Okay, which ones need adjusting??

eatc7402
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Tue 04 Jun '13 15:53    Post subject: Reply with quote

Woops sorry, I read it all wrong. Embarassed

Nope it is that google can't access your local network Wink

Code:

$host= gethostname();
$my_ip = gethostbyname(trim($host));


so my IP is a LAN IP. Just keep the external image in that case.
Back to top


Reply to topic   Topic: Upgraded my WAMP now PHP code won't run correctly View previous topic :: View next topic
Post new topic   Forum Index -> Other Software