I am trying to run PDFTron for php following the instructions.
However, when called: PDFNet::Initialize(); i'm getting an error
Fatal error: Uncaught Error: Call to undefined function PDFNet_Initialize() in .../PDFNetPHP_core.php
I assume that PDFNet_Initialize is part of extension because i can't see declaration in PDFNetPHP_core.php file
I setup exenstion PDFNetPHP.so and enable_dl = on in php.ini. Also when i run test in PDFNetWrappers/Samples/AddImageTest/PHP then it's looks ok:
PDFNet is running in demo mode.
Permission: write
Done. Result saved in addimage.pdf...<br />
when i run php -m module PDFNetPHP is on list
what am I doing wrong?
If the sample code is working on your end, it's likely that your project is unable to find the libPDFNetC.soshared library. The RunTest.sh in the AddImageTest sample sets the following environment variable:
export LD_LIBRARY_PATH=../../../PDFNetC/Lib
You might need to add the .so explicitly, or at least put the .so in a folder that PHP will load .so files from. See your PHP documentation. Please also see the following post:
https://stackoverflow.com/a/35442777/3761687
Related
I'm using Uniform Server with PHP 7.2 and upon running a php page I made I get this error.
Fatal error: Uncaught Error: Call to undefined function mb_detect_encoding()
When I try to enable the mbstring php module (and other modules) through the graphical user interface I get this.
So when I do it manually, my php_production.ini looks like this. I have used Uniform Server to select that php settings file.
extension=gd2
extension=mbstring
extension=exif ; Must be after mbstring as it depends on it
extension=mysqli
So why do I still get the error if I have enabled the modules manually via the text editor?
Here is my phpinfo.
Below is the contents of C:\Users\Documents\UniServerZ\core\php72\extensions
The developer of Uniform Server managed to fix the problem, saying so in this post.
Ok.. Thanks for bringing this up.. Looks like made a mistake on the spelling on the extensions folder. Please rename the /core/php72/extentions to /core/php72/extensions and everything should work as expected.. I have updated the module in Sourceforge.
I'm working in a team on a e-shop website.
Recently, we've passed on Debian Jessie and from php5.4 to 5.6
Since then, we have multiple bug with require and require_once
Here's a file that raise an ERROR 500
<?php
require('/data/vhosts/mycompany.com/public_html/mp/../includes/functions/marketplace_tools.php');
//print_r(get_included_files());
require_once('/data/vhosts/mycompany.com/public_html/mp/../includes/functions/marketplace_tools.php');
echo 'pouet';
?>
The error.log say this :
PHP Fatal error: Cannot redeclare match_marketplace_products() in Cannot redeclare match_marketplace_products() on line 1
The filepath is good.
Marketplace_tools.php don't have require/include in
Marketplace_tools.php is just a bunch of function we use
If I run this file in command line, it works well
If I uncomment the print_r, it does not raise ERROR 500
This bug randomly appear and disapear
Cannot redeclare match_marketplace_products()
This error message tells you that there is a function name (match_marketplace_products) in the file you're including that already exists in the current PHP program.
You're using require_once(), but check that you haven't pulled in the same file elsewhere using require() (or include()).
Also check that the function name match_marketplace_products is only defined in this one file -- if it's defined in another file that is also included, then this will cause this error.
I am trying to implement the tinyMCE spellchecker plugin and I have encountered a problem with enabling PHPs enchant module.
The following code
$enchant = enchant_broker_init();
print_r($enchant);
Returns the following error
Fatal error: Call to undefined function enchant_broker_init()
I am running PHP v5.4.30 on Mac OSX 10.9.5 if that helps at all.
Do I need to do anything in Terminal to enable it or should it already be enabled?
I was setting up a Twitter auto reply bot on my VPS. When I ran the PHP script it gave me an error. Yes, obviously I installed the PECL OAuth extension, added the code to the php.ini file & even checked it to see if it was enabled by creating a phpinfo.php file. Still, nothing.
So I'm really confused here. I even rebooted the server & restarted apache but with no success. So what should I do? Here's the output when I run the script:
PHP Fatal error: Class 'OAuth' not found in
/var/www/html/twitters/TwitterAutoReply.php on line 24
root#Graffocp:/var/www/html/twitters#
Thanks for your help :)
I've got a client who has just set up a new VPN and is attempting to install my plugin.
He's getting the following error:
Fatal error: Call to undefined method SplFileInfo::getRealPath() on the commented line below. This appears to have something to do with the ZEND libraries. Any ideas what I should tell him to do?
If you are getting the undefined error means you have lower version of PHP.
The function is supported after PHP 5.2.2
SplFileInfo::getRealPath
(PHP 5 >= 5.2.2)
SplFileInfo::getRealPath — Gets
absolute path to file
http://php.net/manual/en/splfileinfo.getrealpath.php