Author |
|
eatc7402
Joined: 03 Jun 2013 Posts: 6 Location: Philippines, Davao
|
Posted: Mon 03 Jun '13 12:22 Post subject: Upgraded my WAMP now PHP code won't run correctly |
|
|
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
|
|
Back to top |
|
eatc7402
Joined: 03 Jun 2013 Posts: 6 Location: Philippines, Davao
|
Posted: Tue 04 Jun '13 1:45 Post subject: |
|
|
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
|
Posted: Tue 04 Jun '13 2:25 Post subject: |
|
|
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
|
Posted: Tue 04 Jun '13 6:09 Post subject: |
|
|
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
|
Posted: Tue 04 Jun '13 7:37 Post subject: |
|
|
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
|
Posted: Tue 04 Jun '13 11:40 Post subject: |
|
|
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
|
Posted: Tue 04 Jun '13 12:14 Post subject: |
|
|
Okay, which ones need adjusting??
eatc7402 |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 04 Jun '13 15:53 Post subject: |
|
|
Woops sorry, I read it all wrong.
Nope it is that google can't access your local network
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 |
|