turning on the dom_xml functionality on php 5 - php

I am trying to implement an store locator using php and mysql and google maps
I have gone through this article "https://developers.google.com/maps/articles/phpsqlajax_v3 "
it says "Check your configuration or try initializing a domxml_new_doc() to determine if your server's PHP has dom_xml functionality on."
But apparantly mine is not on because it is giving me this error :
"Fatal error: Call to undefined function domxml_new_doc() in C:\wamp\www\StoreLocator\phpsqlajax_genxml.php on line 5"
I am using php 5, and I am not sure how I can turn it on.
Please help me with your opinions.

This question might help answer your problems.
Are you sure you want to go down the XML route and not the JSON one?

Related

500 error when an unset framework variable is used in template

I got a mysterious error on the page routed to MainController::somefunction
Internal Server Error
Unable to open
[vendor/bcosca/fatfree/lib/base.php:2315] Base->error()
[vendor/bcosca/fatfree/lib/base.php:3130] user_error()
[tmp/1esys3p2sx9xp.3h31n1yj254w8.php:2] Preview->render()
[vendor/bcosca/fatfree/lib/base.php:2875] require('/opt/lampp/htdocs/project/tmp/1esys3p2sx9xp.3h31n1yj254w8.php')
[vendor/bcosca/fatfree/lib/base.php:3121] View->sandbox()
[app/controllers/MainController.php:41] Preview->render()
[vendor/bcosca/fatfree/lib/base.php:1928] MainController->somefunction()
[vendor/bcosca/fatfree/lib/base.php:1728] Base->call()
[index.php:12] Base->run()
In my MainController::somefunction() a variable is set to a template
$this->f3->set('content', 'products.htm');
echo \Template::instance()->render('layout.htm');
And in layout.htm has the following line
<include href="{{ #contents }}" />
The error message did not provide much useful detail. It took me a while to find out that the variable is defined as 'content' in the function but the template referenced 'contents' -- there is a missed 's'.
It would be more helpful if the error could say sth like "undefined variable". Maybe this information will find someone scratching their head.
The primary issue is that your PHP configuration is ignoring "minor issues" like undefined variables. Let PHP report all kinds of issues by calling error_reporting(E_ALL) (after loading F3). Technically, E_NOTICE is enough to report undefined variables. As soon as this flag is set, PHP can show/log (depends on your configuration) a warning and Fat-Free Framework's ONERROR handler can react to undefined variables
Undefined variable: contents
[tmp/21hg1fh3jezo8.1gkglltf97qxb.php:1] Base->{closure}()
[test.php:16] Preview->render()
I recommend to promote warnings to exceptions, too. A good example is shown in a comment of the documentation page of set_error_handler(). This change forces you to program defensively and reveals issue that otherwise would go either unnoticed or result in unexpected side-effects (like your issue).
Feel free to create a pull request against bcosca/fatfree-core that generates a helpful error message when a null file is passed to the template renderer.
#Alan T, #alan-t , right ; just starting with F3 this week i scratched my head 2 days ago with this same issue ; my 2 cents : when something like thing happens, whatever framework or library you are using, proceed with a file search project wide ; for instance in your case you can do a search for "Unable to open" to see where exactly it bugs , and i've been lucky to find the culprid line thanks to the trace with the exact line number displayed.(not the case in your issue/stact trace)
BIG Thanks to #Rayne for all this precious info regarding 'calling error_reporting(E_ALL) after loading F3'
and especially regarding promoting warnings to exceptions; i'm going to update my code base right after this reply
Thanks all to help beginners with what seems to me so far a very efficient packed framework! And the official doc is full of clever code samples when we take time to dig into it! Thanks to all f3 folks
Best regards
Raphael

Ioncube error : Fatal error: Call to undefined function [obfuscated]

I have a script that is encoded with IONCUBE 8.3.
And now , I have a Bad problem that I can't solve it.
the version of Loader is 4.6 on server (its lastest version)
But I see this error :
Fatal error: Call to undefined function [obfuscated]() in .... .
I have already obfuscated all the functions and classes and I can't let them unobfuscated !
So what should I do to solve this ?
I tried to solve it by cheking all function and setting on server .
But they are ok
Assuming that you have encoded the files yourself and that you have the source, a first step would be to disable line number obfuscation so that you can find the location of the failed function call. From that you can look at the source code and identify the function that cannot be found. It may be, for example, that the code is calling a function with a name that has not been obfuscated, and an exclusion list could then be used so as not to obfuscate calls to that particular function.

How to make geoip_country_name_by_name() work?

I want to collect country name of an user who logined to my site. So i used
geoip_country_name_by_name() php function for this purpose.
But i got a fatal error as :
Fatal error: Call to undefined function geoip_country_name_by_name()
How can i avoid this error ?
Is there any other method to get country name using php?
Can someone help me please?
Sounds like the extension is not installed on your computer. Check out this link, it is a PECL extension.
http://www.php.net/manual/en/geoip.setup.php
you need the PECL extension, have a look here http://www.php.net/manual/en/geoip.installation.php

Wikipedia getting Infoboxes With PHP

So I am trying to parse content from an infoboxe template in a wikipedia page. But I have to use PHP because I cannot configure my server alone and I haven't the permission to do that.
(So i cannot use the framework Dbpedia)
I need help because I am trying to understand how I can parse this object Infoboxe.
Example on this url : http://fr.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&rvsection=0&titles=Roger_Federer
Plz Don't tell me to look the documentation, it's boring and not very usefull.
I keep going trying to parse this content but I don't understand how I can do with PHP ?
THhhhhxxxx to help me !! :)))
You can call this python script using exec():
https://stackoverflow.com/a/9208881/956397
exec() manual: http://www.php.net/manual/en/function.exec.php

Call to undefined method in facebook call to publishUserAction

I'm getting the following using the PHP client on my server (connecting via FBML). I've included the appropriate php files (facebook etc..)
Fatal error:
Call to undefined method FacebookRestClient::feed_publishUserAction()
in ..../index.php on line 50
I'm trying to use the example given.
Any ideas?
You might want to take a quick browse/grep through your Facebook API files (facebookapi_php5_restlib.php) and make sure that the feed_publishUserAction() method exists. Perhaps you're using an older version of the API library?
OMG I found the answer
Because the facebookapi_php5_restlib.php that facebook.com provided you is a piece of outdated shit
i.e. you won't be able to find the word feed_publishUserAction in the facebookapi_php5_restlib.php file
HOWEVER, the official facebook smiley demo from this facebook wiki page , contained a more completed facebookapi_php5_restlib.php , along with the feed_publishUserAction function
Which finger would you like to show to the facebook developer staffs?

Categories