How I write PHP to generate PDF from PHP page using wkhtml2pdf ? I am looking for only an example also my server is Linux at godaddy how I can decide which kind of Linux ?
Other suggestions that wkhtml2pdf are welcome
I would recommend a VPS from digitalocean or a VPS from the provider you desire with root access. I used Debian and CentOS without problems. As for today, use the binary from the site because it contains the patched QT version and will eliminate the issues with zoom feature.
I created a gist with minimal sample code to output pdf file to browser here https://gist.github.com/alpenzoo/b3d4b2ae144d00fe2b8d442d03d7fd50
Related
I triyng an image upload exercise from a tutorial found here
Here's the url of the tutorial
https://www.itsolutionstuff.com/post/laravel-8-image-upload-tutorial-exampleexample.html
And I have an issue with the storage. If I use the following method:
$request->image->storeAs('images', $imageName);
to store the image, it will not display in the preview, not even if I run
php artisan storage:link. Initially I got 404 error, but after long trials and errors I finally found that
<img src="{{ URL::asset('storage/images/'.Session::get('image')) }}">
is the only thing that got me closer, but I still get a 403 error.
On a virtual hosting only the public image folder would work. I can't use the store folder, much more private and secure. And this problem is driving me crazy.
I'm testing it using Apache on Windows 10 and I perfectly know that this issue is already addressed in another question here... but the solutions I found in that question only address the Linux operating system and they are not suitable to be tested locally under Windows.
Relative paths don't work with shortcuts in Windows and, since I would run a real life project under a shared hosting, I'm pretty sure that the problem have to do with some Apache directive that may be changed in .htaccess file, or, even better, with an ini_set function.
Thanks for any insight, all this puzzles me a lot!
I'm currently building an module for Drupal 7, which requires the functionality of taking an screenshot of another website and delivering this to the user. For doing this i'm using an php wrapper for chrome (headless).
Aaand: It works on my machine!
But: I realizied, that the project is hosted on a managed server, so i can't install the google-chrome package from the gentoo-repository.
Now my questions is if there is any sort of portable chrome for this use case.
Thank your for helping!
The way i took was using an Amazon Lightsail Instance with an LAMP-Stack. There i could install the required parts. So i'm calling an endpoint on this instance from my drupal module and it's answers with the base64-encoded image data (and some stuff around it).
I was asked to help out with a project that uses CakePHP. I know nothing about CakePHP.
The application was developed on a Linux platform, and I use Windows 10.
I installed and ran up the CakePHP 3.2 demo using IIS, it works.
I then started to install the project I'm supposed to help with.
I started to run into problems so I took a shortcut, I installed the bitnami WAMP environement and installed the CakePHP porect in that, it is using Version 2.8.
I have worked out a few issues, but I am not at a point where I am stumped.
When I run the application, the response emitted to the browser is simply a file name, that of the application, say, xyz.php.Nothing else and no log files or errors.
Would nayone have a suggestion as to where to start to figure this out?
The system I was working with came from a Linux machine and it makes use of Symbolic Links that do not migrate to Windows. The filenames that were emitted to the browser were the failed redirects of the Symbolic Links.
I received a list of the Symbolic Links from the originator and made Windows Symbolic Links, using, MKLINK.
i want to start making a facebook app and using the APIs, but i dont have a website to test anything out. how do i get it working on localhost or is it better to start using heroku for it and upload all my php files onto that
Use XAMPP
It's available for Windows, Linux and for Mac.
I have two web servers, Windows machines running Apache.
One is a backup of the other, so if one fails the other can be used instead.
Does anyone know if it's possible to configure Apache so it displays a small banner/message on each page it serves to say that the user is running on the backup server?
I did find a 3rd party module (mod-substitute-append http://code.google.com/p/mod-substitute-append/) that may have done what I wanted, but there appears to be no documentation for it, and when downloaded looks like it was written to be installed on a Linux machine.
Does anyone have any ideas I can try?
Apache 2.2 ships with mod_substitute: http://httpd.apache.org/docs/2.2/mod/mod_substitute.html
Apache 2.4 ships with mod_sed: http://httpd.apache.org/docs/trunk/new_features_2_4.html
From the documentation, mod_sed does similar things to mod_substitute_append (which I have used, on Linux). It might be worth grabbing an Apache 2.4 Windows binary and seeing how you get on.