Call to undefined function domxml_new_doc() [duplicate] - php

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How to solve “call to undefined function domxml_new_doc()…”
I'm using php5, when I try initializing a domxml_new_doc() it gives following error
Call to undefined function domxml_new_doc()
I checked phpinfo and found that DOM/XML is enabled...
Here is the code line which gives me the error
$doc = domxml_new_doc("1.0");

As suggested by KingCrunch, you're likely to be using PHP5. In that case, just use DomDocument instead.
However if you're still using PHP4, then the following test will tell you whether the extension is loaded:
var_dump(extension_loaded('domxml'));
If it returns false, then you have to enable the domxml library.
If you can modify php.ini, then locate a line extension=domxml.so (unix) or extension=domxml.dll (windows), uncomment it, then restart the web server.
If you cannot find this line, then you may have to install this library, which is outside the scope of this question :)

Related

Php error in curl function [duplicate]

This question already has answers here:
PHP Fatal error: Call to undefined function curl_init()
(24 answers)
Closed 5 years ago.
i got this error while running php code
Call to undefined function curl_init() in C:\wamp\www\OTP\process.php
on line 25 Call Stack # Time Memory Function Location
1 0.0030 151192 {main}( ) ..\process.php:0
how to resolve this
Try following steps:
Click wamp icon. and go to php -> php extension and check "PHP_CURL" is ticked or not.
If not checked then click it and restart wamp.
if you not understand in above then follow below instructions.
Go to your php.ini file and remove the ; mark from the beginning of the following line:
;extension=php_curl.dll
After you have saved the file you must restart your HTTP server software (e.g. Apache) before this can take effect.
"do not forgot to restart server"

XAMPP Fatal error: Call to undefined function mysql_connect() [duplicate]

This question already has answers here:
Undefined function mysql_connect() [duplicate]
(14 answers)
Closed 6 years ago.
I hit this error when running a PHP script on XAMPP, in Windows. Does anyone know how solved it?
Fatal error: Call to undefined function mysql_connect() in
C:\xampp\htdocs\netbanking\dbconnection.php on line 2.
Try:
<?php
phpinfo();
?>
Create and call the page with above code and search for mysql. If not found, Do the following things.
Open your php.ini and
Changed from
;extension=php_mysql.so
into
extension=php_mysql.so
NOTE: mysql extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used.

PHP : Undefined function mysql_connect() [duplicate]

This question already has answers here:
"Call to undefined function mysql_connect()" after upgrade to php-7 [duplicate]
(1 answer)
Undefined function mysql_connect() [duplicate]
(14 answers)
Closed 7 years ago.
I just downloaded the new xampp and try to run my old projects and I got this error
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in F:\xampp\htdocs\try\index.php:17 Stack trace: #0 {main} thrown in F:\xampp\htdocs\try\index.php on line 17
Does it mean that the mysql_connect that I used is not already supported in new xampp ?
mysql_connect()
has been removed from PHP7, which is used by the newest xampp version.
Instead, use mysqli_connect() like in this example.
Another method, PDO is also possible (but is coded in a very different way as mysql_connect.)
The MySQL module is depreciated in PHP5 and removed in PHP7, you can use these:
MySQLi http://php.net/manual/en/book.mysqli.php
PHP::PDO http://php.net/manual/en/book.pdo.php
Check your version by using phpinfo().
Not particularly by xamppp but php itself deprecated mysql Here a quote from them:
The original MySQL extension is now deprecated, and will generate E_DEPRECATED errors when connecting to a database. Instead, use the MySQLi or PDO_MySQL extensions
if you can provide us php version i can help more

sqlsrv in Registered PHP Streams [duplicate]

This question already has answers here:
"Call to undefined function sqlsrv_connect()" when trying to connect to Azure DB from PHP
(2 answers)
Closed 6 years ago.
How can I get sqlsrv in Registered PHP Streams of my php installation?
I am getting the following error:
Fatal error: Call to undefined function sqlsrv_error() in C:\inetpub\wwwroot\twickenham2013\class\sqlsrv.class.php on line 14
How can I fix this?
Im facing the same issue.
Thats because the Registered PHP streams(phpinfo()) does not contain sqlsrv field.
this can be checked using the code
<?php
phpinfo();
?>
add the necessary .dll files in you xampp/php/ext. and edit the php.ini document.
To download the necessary .dll files and for more detailed installation instructions, see the PHP docs: http://php.net/manual/en/sqlsrv.installation.php

PHP escapeshellarg() Issue, with CodeIgniter [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
escapeshellarg() has been disabled for security reasons
I've created an image upload system with PHP and it all works but I still get a warning:
A PHP Error was encountered
Severity: Warning
Message: escapeshellarg() has been disabled for security reasons
Filename: libraries/Upload.php
Line Number: 1066
Does anyone know how to get rid of this without contacting Hosting provider?
You can't. You will have to contact your sys admin to enable that function for you, or use something else (that does not involve executing shell commands) for what you are trying to accomplish.
Try replacing escapeshellarg with #escapeshellarg.
Because, then you'd be suppressing any warning that function call gives.
Since
it all works
Doing that shouldn't be a problem to your working code.
Note: using # to suppress warnings or errors is not recommended.

Categories