Export Server not configured for Highcharts-export-server - php

I'm using highcharts-export-server to save images of the charts and attached results when generating PDF. It was working before but now it seems to be broken. I tried to update the node.js and version of npm that I am using and it keeps giving me an error "Export Server not configured." I run node buid.js and install globally the highcharts-expert server but it still gives me the same error.
Package install:
Node - 14.6.0
NPM - 7.6.3
Highcharts-export-server - 2.1.0

Check if you have the highcharts-export-server installed globally (you can do it with the npm list -g -depth 0 highcharts-export-server) and if you have, uninstall it (npm uninstall -g highcharts-export-server). After that, try to run the following command: highcharts-export-server --nologo 1 --logLevel 4 --infile ./basic.json --outfile ./chart.png --type png --width 500 and if it fails ('highcharts-export-server' is not recognized), try this one: npx ./node_modules/highcharts-export-server/bin/cli.js --nologo 1 --logLevel 4 --infile ./basic.json --outfile ./chart.png --type png --width 500. Please provide here the final results (attach the generated PNG).

In my case, I figure out that this issue was caused by wrong input at the step to confirm the CND.
At the CDN step, just press ENTER instead of input 'Y'. Then all the dependencies will pull from the CDN.
Run the node program, the image will be generated correctly.
Configure the package by running command line as follows at nodejs project root
node node_modules/highcharts-export-server/build.js

I recommend first, export this two environment variable, export ACCEPT_HIGHCHARTS_LICENSE=1 and export HIGHCHARTS_VERSION=9.0, them run npm install.

Related

Vite manifest not found

I Working on project that working with laravel 9 and Vite with laravel-vite,
In Dev environment all thing working fine, but in production cPanel server I has this issue
Vite manifest not found at: /home/???????/cart_shop/public/build/manifest.json
# With
Missing Vite Manifest File
Did you forget to run `npm install && npm run dev`?
I tried to solve the problem but nothing work, I need to change the public folder and the sup folder build file place from vite.config.js but I don't find the way to do that.
Note that: the file sequence is changed in cPanel shared server from
- home
- public_html
- cart_shop
- Root
- public
- etc
To
- home
- public_html
- public files and folders // I changed the index URLs too.
- cart_shop
- Root
- etc
my vite.config.js config is like:
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import vue from '#vitejs/plugin-vue';
export default defineConfig({
plugins: [
laravel({
input: 'resources/js/app.js',
}),
vue({
template: {
transformAssetUrls: {
base: null,
includeAbsolute: false,
},
},
}),
],
});
I had the same issue only because of node version. I upgraded to the latest version and it's working properly.
For Ubuntu use n module from npm in order to upgrade node:
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
To upgrade to latest version (and not current stable) version, you can use:
sudo n latest
You may need also to Fix PATH:
sudo apt-get install --reinstall nodejs-legacy # fix /usr/bin/node
To undo:
sudo n rm 6.0.0 # replace number with version of Node that was installed
sudo npm uninstall -g n
You may need to restart your terminal to see the updated node version.
Found in Ask Ubuntu
Type this it's works for me
npm run build
In my case, I have solved this problem by doing some things.
First of all, I have installed npm by running this command
npm install
After that, I have run
npm run dev
And finally, I have run
npm run build
And one thing I have noticed is my problem is not solved somehow and for that, i have run some command,
php artisan optimize:clear
and after running this command I have run those commands that i have run previously
And finally my problem is solved.
Update Node.js to its latest version: https://nodejs.org/en/
Then run npm run dev.
Remove #vite(['resources/sass/app.scss', 'resources/js/app.js']) from the <head> of the file app.blade.php on Laravel 9. And now it works like a charm.
The issue solved,
first: I try adding publicDirectory configration into laravel-vite-plugin setting in vite.config.js that solve the build issue but manifest still not founded.
Finally: I move all files and folders except build from public to bublic_html then npm run build and it's working fine.
just go to your public folder and there is a hot file in that file there is a link like this http://127.0.0.1:3000 change this link to your domain link i mean your website link
If the manifest.json file does exist but you're still seeing this error, make sure the permissions are good:
sudo chown www-data:www-data -R public/build/
sudo chmod g+w -R public/build/
I had a similar problem and I was able to resolve it by installing the node current stable version. In my case, the node version was 14+, and when I upgraded to the current version which is v16.17.0, everything works just fine. The comments here were helpful.
Visit the official node website to download and install the latest node version.
I solved this problem like this:
npm run build
When you put public files inside public_html. Create a public file in the root of the domain and put the build folder inside it And it was done.
Initially, this is your configurations in the package.json file, You can change the settings in your scripts or just run the vite build command on the terminal.

Error When Installing Magento - Could not validate a connection to Elasticsearch

I'm installing Magento 2 for the first time following this tutorial https://www.javatpoint.com/how-to-install-magento-2-using-composer. XAMPP is installed (with Apache and MySQL running), the database is setup on PHPMyAdmin, but when I try to run php bin/magento setup:install (step 23 in the tutorial) I get the error: Could not validate a connection to Elasticsearch. No alive nodes found in your cluster
How can I fix this?
Download Elastic Search first on your system -
https://www.elastic.co/downloads/past-releases/elasticsearch-7-6-0
After Downloading follow this step -
Extract the .zip file
Open Terminal or command prompt and go to the extracted path
run command .\bin\elasticsearch.bat
if this does not work just go to the extracted folder and opened the elasticsearch.bat file inside the bin folder.
and the install Magento with setup: install command.
Hope it helps!!
Please run this Command in Terminal
sudo service elasticsearch start
And after run that command again run php bin/magento setup:install
Hope Your issue will be solve.
Thank you.

ORA-28547 with php-fpm in docker container

I got a working php-fpm docker container acting as the php backend to a nginx frontend. What I mean by working, is that it renders phpinfo output in the browser as expected.
My php-fpm container was produced by php-fpm-7.4 prod of the devilbox docker repo. It has OCI8 enable.
The issue: I keep getting ORA-28547 when trying oci_connect
What I have done:
1--add /usr/lib/oracle/client64/lib to a file inside ld.so.conf.d and run ldconfig -v
2--restart docker container.
3-- Now phpinfo shows ORACLE_HOME=/usr/lib/oracle/client64/lib
4--Add tnsnames.ora to /usr/lib/oracle/client6/lib/network/admin (there is a README.md file inside that folder that even tells you to do that)
5--Restart docker container again.
6-oci_connect still fails with the same error.
What I am missing?
Thank you very much for any pointers, I think I have browsed to the end of the internet and back without finding a solution yet.
----SOLUTION: reinstall instantclient, relink libraries (ldconfig) to use new instantclient libraries. Create modified dockerfile to do it when container is created.
I modified the Dockerfile file of the php-fpm to add new instant client files and not the one that were provided by the original file. I was not able to make it work with them. I have tried a few times rebuilding the image (docker-compose up --build) and this is the file that does the trick:
FROM devilbox/php-fpm:7.4-work
#instantclient.conf content: /opt/instantclient
RUN echo "/opt/instantclient" >/etc/ld.so.conf.d/instantclient.conf
WORKDIR /opt
RUN wget https://download.oracle.com/otn_software/linux/instantclient/19800/instantclient-sdk-linux.x64-19.8.0.0.0dbru.zip
RUN wget https://download.oracle.com/otn_software/linux/instantclient/19800/instantclient-sqlplus-linux.x64-19.8.0.0.0dbru.zip
RUN wget https://download.oracle.com/otn_software/linux/instantclient/19800/instantclient-basic-linux.x64-19.8.0.0.0dbru.zip
RUN unzip instantclient-sdk-linux.x64-19.8.0.0.0dbru.zip
RUN unzip instantclient-sqlplus-linux.x64-19.8.0.0.0dbru.zip
RUN unzip instantclient-basic-linux.x64-19.8.0.0.0dbru.zip
RUN mv instantclient_19_8 instantclient
ADD tnsnames.ora /opt/instantclient/network/admin
RUN ldconfig -v
CMD ["php-fpm"]
expose 9000
# Insert following to .bash_profile or .profile of the User starting the php-fpm
export ORACLE_HOME=/usr/lib/oracle/client64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export PATH=$PATH:$ORACLE_HOME/bin
export TNS_ADMIN=$ORACLE_HOME/network/admin
# Test to Ping Remote Db to be connected by PHP
tnsping <tns-name of remote DB - i.e. db12c.world>
# restart here the php Engine
Can you please check
https://github.com/caffeinalab/php-fpm-oci8/blob/master/Dockerfile
which seems to create a p-fpm-oci8 docker image
the "wget" for
wget -qO- https://raw.githubusercontent.com/caffeinalab/php-fpm-oci8/master/oracle/instantclient-basic-linux.x64-12.2.0.1.0.zip | bsdtar -xvf- -C /usr/local &&
wget -qO- https://raw.githubusercontent.com/caffeinalab/php-fpm-oci8/master/oracle/instantclient-sdk-linux.x64-12.2.0.1.0.zip | bsdtar -xvf- -C /usr/local &&
wget -qO- https://raw.githubusercontent.com/caffeinalab/php-fpm-oci8/master/oracle/instantclient-sqlplus-linux.x64-12.2.0.1.0.zip | bsdtar -xvf- -C /usr/local && \
can be dropped when you place downloaded instant client files into local host dir
/usr/local
and extract them - resulting in
/usr/local/instantcient_12_2
or 18, 19c equivalents
the 4 "ln" commands have to be adjusted to reflect the local host instantclient dir
the tnsnames.ora for instantclient is available from host by VOLUME command
-------------FINAL SOLUTION------------(it was not network related, I had done a couple of changes to the files, and also tried a different database, all at the same time, so it made me think that it was the different database what fixed the issue)
After many trial and errors, I came up with a Dockerfile that creates the correct configuration of files and connects without any issues to the database:
--Dockerfile: (to build php-fpm 7.4 using devilbox image)
Final solution:
I modified the Dockerfile file of the php-fpm to add new instant client files and not the one that were provided by the original file. I was not able to make it work with them. I have tried a few times rebuilding the image (docker-compose up --build) and this is the file that does the trick:
FROM devilbox/php-fpm:7.4-work
ADD instantclient.conf /etc/ld.so.conf.d/
WORKDIR /opt
RUN wget https://download.oracle.com/otn_software/linux/instantclient/19800/instantclient-sdk-linux.x64-19.8.0.0.0dbru.zip
RUN wget https://download.oracle.com/otn_software/linux/instantclient/19800/instantclient-sqlplus-linux.x64-19.8.0.0.0dbru.zip
RUN wget https://download.oracle.com/otn_software/linux/instantclient/19800/instantclient-basic-linux.x64-19.8.0.0.0dbru.zip
RUN unzip instantclient-sdk-linux.x64-19.8.0.0.0dbru.zip
RUN unzip instantclient-sqlplus-linux.x64-19.8.0.0.0dbru.zip
RUN unzip instantclient-basic-linux.x64-19.8.0.0.0dbru.zip
RUN mv instantclient_19_8 instantclient
ADD tnsnames.ora /opt/instantclient/network/admin
RUN ldconfig -v
CMD ["php-fpm"]
expose 9000
That's why I have suggested to use tnsping - unfortunaly it is not included in any of the instant client files which is a pity - so you have to pick it up from regular client with matching OS, bitsize and Oracle release. As workaround you could place SQL*Plus package files into container and try to connect with a foo user like
sqlplus foo/foo#\<ip>:\<port>/\<dbname>
which should generate an error - if
user/password not matching - ORA-1017 i.e. DB & listener running
listener running - ORA-1034 i.e. DB down
listener down (no return, or TNS-Errors)
I got it!. It was a firewall issue. I launched a tcpdump capture
session and there was nothing wrong with php-fpm, oci8 and
instantclient libraries. The traffic was initiated but there was no
response from the database. I made it work against a different
database where this box has no firewall issues.
I now will try rebuilding the docker image so I can see what I have to
manually add if any.
That was incorrect (the firewall as the origin of the problem). Rebuilding the docker file showed me where I had it wrong. See original question for solution.

PHP installation appears to be missing the MySQL extension which is required by WordPress?

I am currently updating our docker image in Azure.From this image appsvcorg/alpine-php-mysql:0.3 to this leonzhang77/alpine-php-mysql:0.31.
After pasting and save it on container,restart app, when I browse my site (linux.rapidvisa.com , Wordpress 4.9.7,PHP7) that error appeared.MySQL also cannot connect to var/run/mysqld/mysqld.sock.
I tried to fix it. I can see on my phpinfo.php that MySQL/MySQLi is not there or not running.
I am new in this Docker and Azure environment although I managed to enter into SSH and do some tweaking but no luck.
I tried to type sudo apt-get install blah..but command not found.Whenever I typed major commands always -ash: command not found. Can somebody advise me what to do?
i dont know what the exact problem is with your docker construct but your second one is the alpine distribution.
in alpine linux there is an other package manager system.
you have to use apk.
like: apk update or apk add htop

How to compile PHP-CPP on Windows?

I'm compiling PHP-CPP source but i getting error in Windows 7.But, in Linux (for .so extension) it works fine. The error given by the compiler is:
collect2.exe [Error] ld returned 1 exit status
Note: I'm using PHP-CPP not PHP source code directly...
Error: mkdir -p shared/common The syntax of the command is incorrect.
Makefile:190: recipe for target 'shared_directories' failed
mingw32-make: *** [shared_directories] Error 1
PHP-CPP (i'm using)
Error Image
So, you are using MinGW (mingw32-make) in a cmd.exe hosted environment; cmd.exe's mkdir (md) command doesn't offer a -p option, AFAIK. Your makefile appears to expect a POSIX shell hosted environment, so you may have better luck with such, (e.g. the bash shell furnished by MinGW.org's MSYS, or by Cygwin).
You have to download the newest release of phpcpp - then make a build with cmake (just use the cmake gui for windows) - here it's important to set the follwoing entries for build:
PHPCPP_ARCH with "x86_64" and
PHPCPP_PHP_PATH to the path where your root dir of the php source is ...
if you want to build for static libs - set this:
PHPCPP_MSVCRT_STATIC
if you want to have a dynamic build just don't set this Entry ...
Now just click on "Configure" - when its completed just hit "Generate" ..
if all works fine you can now click on "Open Project" and usualy now Visual Studio will load the data needed for compiling ...
Now just compile and now you can use .lib / .dll for further implementations ...

Categories