laravel-snappy can't connect to wkhtmltopdf on live server - cpanel

I am using snappy and wkhtmltopdf to generate pdf. The project working fine in localhost. But when I am uploading the project on the live server (my hosting provider is namecheap and the hosting i am using is their "steller plus" package), i am getting following error:
The exit status code '127' says something went wrong: stderr: "sh: publicwkhtmltopdfbinwkhtmltopdf.exe: command not found " stdout: "".....
Here is my snappy config code what i am using:
'pdf' => [
'enabled' => true,
'binary' => 'public\wkhtmltopdf\bin\wkhtmltopdf.exe' ,
'options' => array(),
],
Now i have searched a while for a solution and found something like wkhtmltopdf need to be installed in the server, need to be using vps hosting etc. I am not an expert in working on cpanel and installing stuffs there. So my questions are:
How can I install wkhtmltopdf in the hosting I described?
In which location it will be installed and what changes will need to be done on the snappy config file?
Will going for a VPS hosting make this work anyway easy?

Related

Vue CLI 3 service worker fails to register out of box

I built my app using Vue CLI3 with PWA. When I build for production the service worker fails to register.
I then decided to check if it was something I did or Vue CLI 3 out the box. I built a brand new app, built it and deployed it to AWS s3 with cloudfront. Even the brand new app without any changes fails to register the service worker with error: "The script has an unsupported MIME type ('text/plain')." and "Error during service worker registration: DOMException"
I've tried quite a few things other than listed below that google search results suggested but I end up with the same error.
I tried using the vue.config.js to load a custom worker in which I just copied the contents of the one that vue produces in a build.
pwa: {
workboxPluginMode: 'InjectManifest',
workboxOptions: {
swSrc: 'public/service-worker.js'
},
themeColor: '#ffffff'
}
I have tried loading it from index.html also.
If I host it locally it registers without any issues
The file does get created and it's accessible from the console but for some odd reason unknown to me it does not want to register at all.
Has anyone had this problem before and how did you resolve this?
Hosted on AWS s3 & cloudfront with HTTPS enabled and using the default AWS certificates for testing.
$ vue --version
3.9.3
$ node --version
v12.7.0
$ npm --version
6.10.0
UPDATE
I found that when I upload to S3 using aws cli sync it changes all .js files content-type
Once I resolve this I will update my question again.

Parsoid: Unexpected Token error and failing to initialize

mwApis:
- # This is the only required parameter,
# the URL of you MediaWiki API endpoint.
uri: 'http://spgenerations.com/wiki/api.php'
On my linux box, I can curl this URL and receive the api data.
Regardless of using the apt-get installation or developer installation (ngm install) both instances give me this error:
{"name":"parsoid","hostname":"play.projecttidal.com.KVM","pid":12636,"level":30,"levelPath":"info/service-runner","msg":"master(12636) initializing 2 workers","time":"2019-03-12T03:55:47.504Z","v":0}
{"name":"parsoid","hostname":"play.projecttidal.com.KVM","pid":12645,"level":60,"moduleName":"lib/index.js","levelPath":"fatal/service-runner/worker","msg":"Unexpected token ...","time":"2019-03-12T03:55:47.917Z","v":0}
{"name":"parsoid","hostname":"play.projecttidal.com.KVM","pid":12636,"level":40,"message":"first worker died during startup, continue startup","worker_pid":12645,"exit_code":1,"startup_attempt":1,"levelPath":"warn/service-runner/master","msg":"first worker died during startup, continue startup","time":"2019-03-12T03:55:48.925Z","v":0}
For context, the hostname here is incorrect and the domain has been removed.
This is my parsoid config:
// Parsoid configuration
$wgVirtualRestConfig['modules']['parsoid'] = array(
'url' => 'server.spgenerations.com',
'forwardCookies' => true
);
I have tried everything under the hidden voodoo sun to get this thing to work and I'm beyond frustrated. 4 hours spent tinkering with URL links to no avail, so please, if you know anything relating to this error, lend a hand.
Check what Node.JS version you are running with:
nodejs --version
If it is 4.x: That's too old for Parsoid. I had the same situation (Debian 9, still such an old Node.JS version in the repositories..). After upgrading to 10.x it ran fine for me.
I used the following guide (see Install using a PPA) to update to a newer Node.JS release: https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-debian-9

Composer needs a proxy to install laravel apparently, where do I get that? can I set it up myself using apache?

I was trying to get started with Laravel just last night, so I tried to install it with composer but it wouldn't go through and kept sayin The "https://packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. , so I looked around and found out that you need to tell composer to use a proxy.(q1 q2 q3).
Well now this might sound silly but honestly I had no idea what a proxy was until last night, so I went and studied it a bit and I got this far:
"Proxy means to act on behalf of another. In the context of a Web server, this means
one server fetching content from another server, then returning it to the client"
and apparently there's 2 kinds of proxy: forward proxy and reverse proxy.
In those 3 pages that I just showed, they were saying before runing php bin\composer global require "laravel/installer=~1.1" you have to set an env var like this: set http_proxy=username:password#proxy_server:port
So now my question is: I still don't know where can I get a proxy like that, should I set it up myself with apache? is that gonna even work? what do I do?
Your thoughts would be appreciated, thank you.
Edit: Environment info:
I'm on windows 7
installed xampp-win32-5.6.14-0-VC11-installer
all of those 5 important extensions are all enabled in phpinfo()
the path= C:\Users\UserName\AppData\Roaming\Composer\vendor\bin is set in environment variables
here's a picture of the whole error
here's the result of php -m i.stack.imgur.com/wz030.png
Some stuff that I tried:
I went into these sites: proxy4free.com us-proxy.org proxylist.hidemyass.com ultraproxies.com,
I tried this: set https_proxy=https://xteamweb.com:xteam#75.55.165.86:8088 and this one: set http_proxy=http://1proxy.space and many others from those sites: i.stack.imgur.com/6YWyp.png
but no matter what, this is the result of all of them: i.stack.imgur.com/mqOrP.png
Still nothing...
Ok here's the solution, if you're having the same problem:
1:
Make sure these are all uncommented in php.ini:
extension=php_openssl.dll
extension=php_curl.dll
extension=php_sockets.dll
extension_dir="E:\xampp\php\ext"
browscap="E:\xampp\php\extras\browscap.ini"
Add these 2 lines at the end of php.ini
curl.cainfo=c:\openssl-1.0.2d-win32\ssl\cert.pem
openssl.cafile=c:\openssl-1.0.2d-win32\ssl\cert.pem
2:
Run this: php -r "print_r(openssl_get_cert_locations());"
and you'll get:
Array
(
[default_cert_file] => c:/openssl-1.0.2d-win32/ssl/cert.pem
[default_cert_file_env] => SSL_CERT_FILE
[default_cert_dir] => c:/openssl-1.0.2d-win32/ssl/certs
[default_cert_dir_env] => SSL_CERT_DIR
[default_private_dir] => c:/openssl-1.0.2d-win32/ssl/private
[default_default_cert_area] => c:/openssl-1.0.2d-win32/ssl
[ini_cafile] => c:\openssl-1.0.2d-win32\ssl\cert.pem
[ini_capath] =>
)
3:
Make these folders:
c:\openssl-1.0.2d-win32
c:\openssl-1.0.2d-win32\ssl
c:\openssl-1.0.2d-win32\ssl\certs
c:\openssl-1.0.2d-win32\ssl\private
Download this: http://curl.haxx.se/ca/cacert.pem.
Rename it to cert.pem and put it in c:\openssl-1.0.2d-win32\ssl\.
Rename it to cert.crt and put it in c:\openssl-1.0.2d-win32\ssl\certs\.
So:
c:\openssl-1.0.2d-win32\ssl\cert.pem
c:\openssl-1.0.2d-win32\ssl\certs\cert.crt
4:
Download https://getcomposer.org/Composer-Setup.exe and install it, It will no longer gives u the ERR_CONNECTION error.
Go to c:\users\YOURUSERNAME.
composer.bat should be there, if not create it yourself.
Add c:\users\YOURUSERNAME to your path.
Edit composer.bat and delete what's in it and put this in #php "%~dp0composer.phar" %*.
Download https://getcomposer.org/composer.phar.
Place composer.phar in c:\users\YOURUSERNAME.
5:
Done.
Composer will now install laravel using: composer global require "laravel/installer=~1.1" with no problem.
(Plus: now composer command is available globally instead of using it like: php composer.phar or php bin\composer).

Erlang can't connect to any HTTPS url

The problem arose when I was trying to build rebar3, but it couldn't fetch its dependencies from Amazon S3. Debugging into the problem I found out that the erlang runtime couldn't connect to any HTTPS site, although curl or wget work completely fine. When I set httpc:set_options([{verbose,trace}]), I get the following output:
{failed_connect,
[{to_address,{"s3.amazonaws.com",443}},
{inet,
[inet],
{eoptions,
{undef,
[{ssl,connect,
["s3.amazonaws.com",443,
[binary,
{active,false},
{ssl_imp,new},
inet],
20000],
[]},
{http_transport,connect,4,
[{file,"http_transport.erl"},{line,135}]},
{httpc_handler,connect,4,
[{file,"httpc_handler.erl"},{line,891}]},
{httpc_handler,
connect_and_send_first_request,3,
[{file,"httpc_handler.erl"},{line,905}]},
{httpc_handler,init,1,
[{file,"httpc_handler.erl"},{line,242}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,239}]}]}}}]}
Where can I look to find out what the problem is ?
You are missing the ssl Erlang application. Some Linux distributions split Erlang into several subpackages. You should make sure that you have the package erlang-ssl installed on your system.

ImpressPages - Unable to add plugin / themes

I am new to Impress Pages. Using version 4.2.7 ( Installed 4.2.6 and upgraded from within the CMS). I have the following issues;
Tried to add the "PHP" plugin and got error message
"Plugin signature verification failed" . Plugin is NOT ADDED
I tried to add a new theme and got the error message Unknown error. Please see logs.
Where are these logs ? I have tried /var/log/apache2/error_log , etc.
Update 1: The log within the cms shows ;
2014-11-01 17:00:44 Cron.finished array(0) { } 2014-11-01 17:00:44
Cron.started array(7) { 'firstTimeThisYear' => bool(false)
'firstTimeThisMonth' => bool(false) 'firstTimeThisWeek' => bool(false)
'firstTimeThisDay' => bool(false) 'firstTimeThisHour' => bool(true)
'lastTime' => int(1414828943) 'test' => NULL }
I dont see anything related to plugins or themes ? Is there another log ?
The error says that the signature of the file can't be verified. There may be two reasons for that:
Your server is missing some encryption lib. But I guess current implementation should not require any additional libs.
The downloaded file is not what had to be downloaded. That could be due to DNS errors, network error, etc.
Which case it is can be told only by debugging. You can always download plugins from market.impresspages.org and install them manually.
If you want to debug, first place to look at is file/secure/tmp dir. You should find the downloaded plugin there. Have a look if you can unzip it. If you can un-zip, you have the problem number 1, otherwise 2.
Most likely your server couldn't download files from Internet.
You can