PHP wkhtmltoimage not working with shell_exec - php-7

I am trying to take screenshot like this:
shell_exec("/usr/bin/wkhtmltoimage http://google.com screen.png");
But it is not creating screen.png. But when I run
/usr/bin/wkhtmltoimage http://google.com screen.png
from terminal it works as expected. I am confused what is wrong.
I tried to write log like:
shell_exec("/usr/bin/wkhtmltoimage http://google.com screen.png > debug.log 2>&1");
I get log "QXcbConnection: Could not connect to display
Aborted (core dumped)" on debug.log. I have php7.0 installed with Nginx on Ubuntu.
What would be the solution for this? Please share if someone solved the same.

Related

#1558 - Column count of mysql.proc is wrong. Expected 21, found 20. Please use mysql_upgrade to fix this error

I got this message when I try to run query on XAMPP in macOS
#1558 - Column count of mysql.proc is wrong. Expected 21, found 20. Created with MariaDB 100108, now running 100421. Please use mysql_upgrade to fix this error
I tried to write
'mysql_upgrade -u root -p'
on my terminal but I got this message
zsh: command not found: mysql_upgrade
I also ran into same issue and after cracking my head for the past 10hrs, I finally realise how to perform the upgrade. U
go to your Mac terminal and paste the following code:
Applications/XAMPP/xamppfiles/bin/mysql_upgrade -u root -p
Supply your root password and see it work like magic.
Contrary to what many people posted online by using /opt/lampp/bin
It always gives a zsh not found error.
I hope this helps you and in the future for others who might need it.
You could try switching to a different shell, say bash by typing bash in your terminal.
Then proceed to run mysql_upgrade normally in the appropriate directory
I also could not run the code from the Terminal. I was, however, able to go to the folder itself and "run" the mysql_upgrade application. If you are using XAMPP and the Application Manager, there's a button to Open Application Folder. If you click that, finder will open where XAMPP lives. Open the bin folder. Then scroll until you find mysql_upgrade. Double click it. It will run in a Terminal session and complete the upgrade. Hope this helps someone else as I spent waaayyyy too much time trying to get this to work.

Elm install always fails with "ConnectionTimeout" error (in WSL)

I'm new to Elm. and I'm not good at English. So, if any ambiguous or wrong thing is there, please let me correct it.
----------- edit -----------
All my problem below is on WSL. when I'm trying on windows, all work fine. then... why elm install doesn't work on WSL? did you have any idea?
-------- problem --------
when I try to elm-test init, it doesn't work like below
$ elm-test init
Here is my plan:
Add:
elm/random 1.0.0
elm-explorations/test 1.2.2
Would you like me to update your elm.json accordingly? [Y/n]:
-- PROBLEM DOWNLOADING PACKAGE -------------------------------------------------
I was trying to download the source code for elm/random 1.0.0, so I tried to
fetch:
https://github.com/elm/random/zipball/1.0.0/
But my HTTP library is giving me the following error message:
ConnectionTimeout
Are you somewhere with a slow internet connection? Or no internet? Does the link
I am trying to fetch work in your browser? Maybe the site is down? Does your
internet connection have a firewall that blocks certain domains? It is usually
something like that!
but my Browser(Chrome) is working beautifully, and even in WSL (the environment that I run elm-test init command at) is too.
$ curl https://github.com/elm/random/zipball/1.0.0/
https://codeload.github.com/elm/random/legacy.zip/1.0.0<body>You are being redirected.</body></html>
then I also try again to redirect the URL
$ curl https://codeload.github.com/elm/random/legacy.zip
Warning: Binary output can mess up your terminal. Use "--output -" to tell
Warning: curl to output it to your terminal anyway, or consider "--output
Warning: <FILE>" to save to a file.
I think there's no Network Problem. My PC can connect with the repo, and I think it will be downloaded well.
I lastly tried just elm install, and that throws the same error too. it seems like Elm can't connect with the repo, even if My PC can.
$ elm install elm/random
Here is my plan:
Add:
elm/random 1.0.0
Would you like me to update your elm.json accordingly? [Y/n]:
-- PROBLEM DOWNLOADING PACKAGE -------------------------------------------------
I was trying to download the source code for elm/random 1.0.0, so I tried to
fetch:
https://github.com/elm/random/zipball/1.0.0/
But my HTTP library is giving me the following error message:
ConnectionTimeout
Are you somewhere with a slow internet connection? Or no internet? Does the link
I am trying to fetch work in your browser? Maybe the site is down? Does your
internet connection have a firewall that blocks certain domains? It is usually
something like that!
Please help me, what should I do?
I recently had reason to use WSL for elm development. It wasn't much fun and I'm glad to be back on Mac! What I found was that certain disk operations on WSL seemed to go very slowly and that could lead a variety of weird issues.
I was using Webstorm, which does not handle WSL well, so in the end I did everything on C: drive (rather than in /home/...) so that webstorm could run the windows version of elm-format, while my node development environment was run on the linux layer.
That's not a precise answer to your question but just to say that it can be done, but its not an ideal way to write Elm code in my experience
I had same issue and it was solved.
It was due to DNS server settings.
Create a file /etc/resolv.conf and write the following line.
nameserver 8.8.8.8
Then WSL will refer to Google Public DNS and works fine.
However, when restart WSL, the settings revert back.
Therefore, the following settings are also required.
Create a file /etc/wsl.conf and write the following line.
[network]
generateResolvConf = false
wsl --shutdown and restart WSL.
Reference link
https://github.com/microsoft/WSL/issues/4285#issuecomment-522201021

pyspider phantom is not enabled ;501 Sever Error

I used pyspider to crawl a website, when using PhantomJs, an error occurred as follows:
I've searched for the solutions in https://github.com/binux/pyspider/issues/215,
the author's seemed to solute it, so I tried, but it didn't still. How to solve it?
You need to check if phantomjs is in $PATH
try the following:
phantomjs -v
or try the following and check the output
pyspider phantomjs
it should output
phantomjs fetcher running on port 25555
Otherwise you will need to install phantomjs on your system.

Pentaho does not run and in console it gives the error of ERR_INCOMPLETE_CHUNKED_ENCDODING?

When I run pentaho it loads some scripts and files but some of them fails with the error of:
ERR_INCOMPLETE_CHUNKED_ENCDODING
In console I see that $ is undefined for jQuery.
I didn't change anything. Once I reran the pentaho and it worked, but it does not work at all.
Is there something I could do about it? What this mean? I searched for CDF.js file and I saw that the file is present.
Any help?
The problem was that /var/ partition was full 100% and pentaho, nginx could not log at all. Nginx could cache results.
By freeing space the problem went away.

Apache and Sqlite3 issue

I'm using ports only on this server. After restarting apache I got "segment fault (core dumped)" message. But apache is started at least... httpd-error.log shows this:
profiling:/usr/ports/databases/sqlite3/work/sqlite-3.7.3/.libs/sqlite3.gcda:Cannot open
profiling:/usr/ports/databases/sqlite3/work/sqlite-3.7.3/.libs/sqlite3.gcda:Cannot open
profiling:/usr/ports/databases/sqlite3/work/sqlite-3.7.3/.libs/sqlite3.gcda:Cannot open
profiling:/usr/ports/databases/sqlite3/work/sqlite-3.7.3/.libs/sqlite3.gcda:Cannot open
Listing of that dir:
baccy# ls /usr/ports/databases/sqlite3/work/sqlite-3.7.3/.libs/
libsqlite3.a libsqlite3.la libsqlite3.lai libsqlite3.so libsqlite3.so.8 sqlite3 sqlite3.gcno sqlite3.o
On this system I've got redmine installed, that's why sqlite is included in here.. now I installed django and I need sqlite3 so much..
It would be nice to know, WHY this error appears, and HOW to handle this =)
Just found an answer
it's GCONV param fault... just go to /usr/ports/databases/sqlite3 and then make config, and remove GCONV param.