I'm trying to use FPDF on my server and part of that is downloading an image file that is placed in the PDF. The code is working perfectly on one machine and a server, however when using another XP laptop I'm getting these error messages.
Warning: imagecreatefromgif(): php_network_getaddresses: getaddrinfo failed: NO such host is known in C:\wamp\www\fpdf.php
FPDF Error: Missing or incorrect image file:http://www.personal.psu.edu/rdl5038/dino.gif
I have tried changing the image to an image that is stored locally on the machine and this works fine. As soon as I try an external link it fails. I have checked the php ini for the allow_url and this is turned on. REally stuck as there seems to be a security problem somewhere. Could it be something to do with access rights / read/write as the laptop is pretty locked down (work one - financial services)
You could try using cURL or another system to download to a temp file and uses it with FPDF.
Related
I have two machine (LapTop & DeskTop),
so I use WWW in a cloud OneDrive folder,
pro easier synchronisation.
Strangely I didn't had any trouble until june,
when I installed the last Windows 10 2019 Creator Update…
I formatted my C drive and installed the update,
but the problem is that I use an other drive of 1To pro my OneDrive files (with 1To subscription),
and of course in properties,
the authorisation using my login who is linked to my Hotmail,
was not recognized,
and shown as a long number
I changed all authorisation with the actual login.
But now when I launch a php page on local host, I get this message :
Laragon
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'I:/Users/nemza/OneDrive/www/taocodex/templates/ueb/wp/converter/WP_converter_18_columns.php' (include_path='.;C:/laragon/etc/php/pear') in Unknown on line 0
wamp64 :
( ! ) FWarning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
( ! ) Fatal error: Unknown: Failed opening required 'I:/Users/nemza/OneDrive/www/index.php' (include_path='.;C:\php\pear') in Unknown on line 0
I can't find a solution on Google, and I know that before it was working, I don’t have trouble with HTML files,
any solution ?
Don’t tell & answer me to use www in Laragon folder, I don’t want to do this.
Few day after,
I have formated the I:\ drive, and reinstalled and downloaded the OneDrive files.
But I still have this problem ?
If use i:\users\nemza\www it's working fine,
if use i:\users\nemza\OneDrive\www, not.
{Image refused because not 10 of reputation.}
What are the "security setting" that I should use ?
What is the problem ?
I written in Laragon forum without any response !
Any advice please ?
Can someone help please ?
Thank you, good day.
Changed security settings in properties.
Reinstalled application with administrator power.
Formatted the drive.
added path ".;C:\laragon\etc\php\pear" & "C:\laragon\etc\php\pear" in System & User Environment variable, with no success.
Asked a friend to install Laragon, and set WWW in OneDrive, exactly the same problem.
If you don't want to use default www folder of laragon try any other folder outside Onedrive. you can do c:/www.
If you want to use Onedrive for syncing purposes i do recommend to use git instead
If you want to collaborate with somebody i do recommend to use following addons of VScode Live Share or Remote Development (Depends on use case)
I wrote above based on my experience and reasons why i wanted to use Onedrive for my code projects, even if you find a way to make it work again with Onedrive i do not recommend using it for servers, code or basically any project with multiple files that are being updated frequently.
I had cases of syncing issues where files were not uploaded fully on the server not showing any signs of errors, or onedrive corrupting files inside my local environment.
No issues so far for regular use, like archiving, syncing images or working with office documents.
PHP Version: 7.0.14
Working on Windows Server 2012
Database files are in D: drive
Website/Application is assigned to the Application pool correctly
Assigned Application pool has the permissions to D: drive
Trying to connect and fetch information from ToppSpeed Database.
Created DSN correctly using Topspeed ODBC Driver.
I have created a sample script to verify if it is working or not.
odbctest.php
$conn=odbc_connect("DSN_NAME",'',''); //Make a coonection to DSN
if (!$conn){
exit("Connection Failed: " . $conn);
}
$sql="SELECT * FROM ExampleTableName"; // Query String
$rs=odbc_exec($conn,$sql); //Execute Query <--- Error Line
if (!$rs) {
exit("Error in SQL");
}
while (odbc_fetch_row($rs)){
var_dump(odbc_result($rs,1));
}
odbc_close($conn);
Error:
PHP Warning: odbc_exec(): SQL error: [SoftVelocity Inc.][TopSpeed ODBC Driver][ISAM]ISAM Table Not Found, SQL state S0000 in SQLExecDirect in C:\inetpub\wwwroot\projectFolder\odbctest.php on line 9
Working: When I run same file on PHP inbuilt server using command > php -S localhost:8002
and run file in a browser at http://localhost:8002/odbctest.php Everything works fine.
Working: When I run file in command line > php odbctest.php It works fine I got data from the table.
Not Working: I have added the website in IIS Manager, bind the website(physical path is C:\inetpub\wwwroot\projectFolder ) with the local IP
When I open that odbctest.php in a browser with local IP I am getting Table NOT Found error.
Same Script, Only difference is it is running on Command Line and not on IIS server, It is running on PHP inbuilt server and not working on IIS.
other Technical Difference is
I have put one PHP file to see PHP information on both servers.
Here is the only difference I found in that.
Working On PHP inbuilt server: In PHP info Server API is: Built-in HTTP server
Not working on IIS Server: in PHP info Server API is: CGI/FastCGI
there is not issue in DSN string because when I change the DSN string with unknown it identifies that there is something wrong in DSN string.
I think there might be some permission issue when trying to access data from IIS server (PHP runs on CGI/FastCGI).
I am wondering if there is permission issue why the error says table not found!!
I don't find any good documentation for TopSpeed Database connection error as this database is not widely used.
Any suggestion or idea? Please advise. Thank you in advance.
The database SQL error was not stating anything about permission,
so I created a simple another PHP script to append data to TEXT file.
I ran that PHP script with two test cases on the IIS server
Test Case 1: Write in a text file which resides in the project directory(same server)
And PHP script executes correctly and it wrote data to text file.
Test Case 2: I change the text file path with the file D:\some_directory\logfile.txt (Resides on D drive)
And when I ran it again script again I got the following error:
Warning: file_put_contents(D:\some_directory\logfile.txt):
failed to open stream: Permission denied in
C:\inetpub\wwwroot\project-directory\write.php on line 12
It confirms there is some problem with the Permissions
App pool assigned to the Website in IIS manager already had the permission to D: Driver. So it was not the problem.
In more research, I found that
we need to identify the USER first that we need to provide the permissions and the user is the value of "Anonymous user identity"
https://stackoverflow.com/a/32033941/5236174
https://www.iis.net/configreference/system.webserver/security/authentication/anonymousauthentication?showTreeNavigation=true
I saw that the value of Anonymous user identity was not the Application Pool!!
I changed that to the Application pool identity.
So now the website/application's anonymous user identity become the App pool and that has correct permissions.
Afthesethis changes, everything works perfectly fine as there is no permission issue.
I have an OpenCart e-commerce system setup. I tried to use TCPDF module for generating PDF Invoices of my existing orders.
Module Name: TCPDF
URL: https://sourceforge.net/projects/tcpdf/
Version: 5.9.202
Release date: 2012-12-16
Author: Nicola Asuni
This Modules seems to work fine on my Local (Dev Environment) but it does not function on my Production environment (which is similar in configs).
Error:
Warning: file_exists(): Unable to find the wrapper "chrome-extension" - did you forget to enable it when you configured PHP? in /var/www/html/2store/catalog/tcpdf/tcpdf.php on line 2Warning: file_exists(): Unable to find the wrapper "chrome-extension" - did you forget to enable it when you configured PHP? in /var/www/html/2store/catalog/tcpdf/tcpdf.php on line 2
TCPDF ERROR: [Image] Unable to get image: chrome-extension://lifbcibllhkdhoafpjfnlhfpfgnpldfl/call_skype_logo.png
I tried troubleshooting but I am not able to find what is causing it. Can anyone please advice?
Firstly, you're using a really old version of TCPDF. You should use the latest version from https://github.com/tecnickcom/TCPDF.
Secondly, it looks like you're asking TCPDF to include an image using a URL but you are providing a URL that would probably only work locally on a browser. The wrapper that the error is talking about is related to streams. See http://php.net/manual/en/intro.stream.php Basically, "chrome-extension" is not a valid stream. Examples of valid types of streams can be found here: http://php.net/manual/en/wrappers.php I'm surprised this URL worked locally, but I guess it's because you have Chrome installed locally so your operating system is being nice and allowing PHP to access the file referred to by that URL.
To resolve your issue on the server you will need to grab a copy of the file that you want to include in the PDF file, put it somewhere on the server in a directory that the web server user can access and provide that file name to TCPDF.
We're wanting to create some html reports for clients for easy viewing of data within their Omnis database so that they don't have to do a full log into Omnis to get some basic information. We've been working with php and odbc and things are working without any issues on our testing environment, which is all on the same computer.
We then moved to testing it more, this time by placing the datafile onto a server, and linking the odbc driver to that datafile. It dies with:
Warning: odbc_connect() [function.odbc-connect]: SQL error: Unable to read disk (bad disk), SQL state 08001 in SQLConnect in C:\xampp\htdocs\jP\includes\database.php on line 22
The ODBC link works fine with Excel we can look at and read all the records as needed.
The datafile on the server is a direct copy of the datafile on the local computer, same user name and passwords.
Line 22 in the php file is
$odbc_conn = odbc_connect($name_odbc, $odbc_user, $odbc_pass)
The user name and password are correct, we've also tried leaving them blank, which works on the local data, but neither work with the remote data.
The server is sitting on the same network, and we have tried two different servers, with the same result for both.
Any hints would be appreciated.
Randall casts "Resurrect" on thread:
I had this exact same problem: attempting to open an OMNIS datafile over a network connection. The solution that worked for me was to set the filename in the 32-bit ODBC DSN connection manager as the network path to the file (\SERVER\Directory\File.cf1) rather than via the drive map. Using the drive map caused this error.
i am trying to copy a image, it is hosted here, this is just an example:
http://111.74.239.161:8898/uploads/allimg/130821/2-130R1100341.jpg
I want to copy the image, but i keep getting connection refused. What could be the root of this error ?
What strikes me as odd is that its using port 8898 ?
If you can view the image in a browser that is on the same machine as your program, then it might be that the server won't send the picture unless you look like a user rather than a program. In that case, modifying the browser identification string might fix your problem.
If you cannot view the image from a browser running on the program's PC, you will need to look elsewhere for the source of your problem.