Can't import PDF with mpdf - pdf

everyone.
I started using mpdf on my website recently. Creating new pdfs is working fine, but i can't import existing ones. I get this error whenever i try to execute the import:
mPDF error: Cannot open ../folder1/folder2/folder3/folder4/folder5/thisisthepdf.pdf !
(that is not the real path)
I included the mpdf in the php. The folder and the files are on chmod 777 and the pdfs are all version 1.4
This is the way i am trying to import.
$mpdf=new mPDF();
$mpdf->SetImportUse();
$pagecount = $mpdf->SetSourceFile('../folder1/folder2/folder3/folder4/folder5/thisisthepdf.pdf');
$tplId = $mpdf->ImportPage($pagecount);
$mpdf->UseTemplate($tplId);
$mpdf->WriteHTML('Hallo World');
$mpdf->Output();
I tried various ways to import i found on stackoverflow and other sites, but nothing worked. Not even the code from the official mpdf manual i am using (the one above) is working.
Trying to solve this issue for quite a while now, but i am out of ideas. I Hope someone can help me. Thanks in advance!

This error message is raised because of a failing call of a simple fopen(). Which means that the PHP script simply cannot access the file.
So ensure that the path is valid by e.g. passing it to realpath(), as it seems to be a relative path. If this evaluates to false the path is simply wrong. Otherwise it is a permission issue.

Related

Apache can't find folder, although it exists

When running server in development everything works fine.
Once I run the same code in Apache server it gives an error
NotFoundError at
/Tensorflow/workspace/models/my_ssd_mobnet/pipeline.config; No such file or directory.
The exact point at which error emerges, seems to be here:
configs = config_util.get_configs_from_pipeline_file(files['PIPELINE_CONFIG'])
I gave all possible permissions I could only give.
I am using django restframework as backend. But I don't think that's where the problem is.
If anyone have any ideas how to resolve this. I would be super grateful!
Ok so, I figured it out. The problem was that apache needs to have an absolute path. So, if you are building your django project in development put absolute path everywhere.
In my case it looks something like this
configs = config_util.get_configs_from_pipeline_file('/var/www/html/BackendUser/'+files['PIPELINE_CONFIG'])

Can download but file will not unzip as expected

I'm attempting to access the Geometadb database which first involves download of the SQL library. I did that and then I got the Geometadb library.
library(GEOmetadb)
Next I need the Geometadb file which is where things start to go wrong. I issue this command as seen exactly in the tutorial: https://bioconductor.riken.jp/packages/3.0/bioc/vignettes/GEOmetadb/inst/doc/GEOmetadb.html
if(!file.exists('GEOmetadb.sqlite')) getSQLiteFile()
It should proceed to not only download a .gz zip file but also unzip the file. It downloads it but never unzips it. Instead I get the following error.
trying URL 'http://dl.dropbox.com/u/51653511/GEOmetadb.sqlite.gz'
Error in download.file(url_geo, destfile = localfile, mode = "wb") :
cannot open URL 'http://dl.dropbox.com/u/51653511/GEOmetadb.sqlite.gz'
In addition: Warning message:
In url(url_geo_2, open = "rb") :
cannot open: HTTP status was '403 Forbidden'
Just not sure what's going on here. Considering these are just the early tutorial steps I'm probably missing something really obvious but I'm hoping someone can help me out. Thanks!

typo3 update 4.7 -> 6.2 - broken backend

I've performed an update from typo3 4.7.20 to 6.2.15. The process worked fine and there were no critical errors while running the install tool.
The frontend looks fine but the backend is broken:
I've removed all uncompatible extensions before I run the update. I've also checked all settings in the installationtool und deleted the temp/cache folder first.
I've got the feeling that the error is caused by the TemplaVoila! extension, I'm using v. 1.9.8. Firebug does not shows any error.
Does anyone had a similar problem and have already solved it?
Thank you very much!
I have come across this one multiple times. More often it is because there is a broken TBE_STYLES. I suggest you look around for $TBE_STYLES in your typo3conf folder and disable it for the time being. Most likely it will be in the extTables.php or some other file which is included dynamically.
seems BE is working, but you css does not got loaded.
check your 'web inspecter' to see if you get errors on loading CSS.
clear your cache (remove everything in typo3temp) and try again

Class 'Google_Service' not found

I am working on the Google + API blogger code. I have downloaded this file
https://github.com/google/google-api-php-client
I have inserted my Google Developer codes in the right places I do believe.
I am getting this error
Fatal error: Class 'Google_Service' not found in /home3/aundie/public_html/dandewebwonders.com/Blog/google-api-php-client-master/src/Google/Service/Blogger.php on line 33
Any help for a new developer in training would be most helpful. Thank you in advance
Try to include autoload.php file as the first require statement. I got the same error and this solved it for me.
require_once 'google-api-php-client/src/Google/autoload.php';
I hit the same problem as well. The solution is moving to php 5.3 or higher, as the Google API PHP client uses the newer class loading mechanism in php.
Just as the following at the beginning of the code, the same as advised by Lamiaa El-morsy
require_once 'src/Google/autoload.php';
On the GitHub page, they've explained the requirement.
So, you must install the required library first, by doing the following command if you're using composer.
$ composer require google/apiclient:^2.0

Khan Academy API displayed on Geektool

I have been experimenting with the Khan Academy API found here
http://api-explorer.khanacademy.org/api/v1/user
and tried to find a way to display a user's points (and maybe some other information) on the desktop using geektool. I tried this
stackoverflow.com/questions/12514722/khan-academy-php-oauth-code
and
github.com/Khan/khan-api/
but nothing seems to work. The first link is the khan academy API provided as is. The second is someone with a similar problem who found a solution. He wrote a PHP script according to the temboo library and said to replace a few fields of the PHP and add both the PHP and the Temboo source code to the webroot. So, I added a folder called "php-sdk" into the webroot which is in /Library/WebServer/Documents/ and inside that folder was another folder "src" which contained the Khan Academy API and the Temboo library. Here is what I had.
cl.ly/image/2c2Z1B3T443L
Then I took a look at this and followed the steps until 6:19. Then I started the Apache server by entering this in terminal...
sudo apachectl restart
I opened a web browser, and typed in this...
localhost/php-sdk/src/khanAcademy.php
and I got this...
Warning: require(php-sdk/src/temboo.php): failed to open stream: No such file or directory in /Library/WebServer/Documents/php-sdk/src/khanAcademy.php on line 66
Fatal error: require(): Failed opening required 'php-sdk/src/temboo.php' (include_path='.:') in /Library/WebServer/Documents/php-sdk/src/khanAcademy.php on line 66
any ideas on what this could mean or how I could fix this? I am not advanced in PHP, or python, but I really would love to find a solution to this problem and I am willing to try anything that might work.
This error:
Warning: require(php-sdk/src/temboo.php): failed to open stream: No such file or directory in /Library/WebServer/Documents/php-sdk/src/khanAcademy.php on line 66
indicates that the path you're using for require is likely incorrect. Currently your PHP is trying to find a file called temboo.php here:
/Library/WebServer/Documents/php-sdk/src/php-sdk/src/temboo.php
Note the repeated directory structure. I'll make an assumption that your temboo.php is in the same directory as your khanAcademy.php file. In that case, simply change require "php-sdk/src/temboo.php" to require "temboo.php". If my assumption is incorrect, just adjust the include path accordingly.