Phantomjs won't install: Autoconfiguration Error - phantomjs

When trying to install Phantomjs on Ubuntu 22.04, I get the following error:
There are some Q.& A's here from 2015-2022, I tried all of the included suggestions.
https://github.com/ariya/phantomjs/issues/10904
https://gist.github.com/julionc/7476620
wkhtmltopdf - libfontconfig.so.1: cannot open shared object file
http://ubuntuhowtoo.blogspot.com/2019/05/linux-nodejs-phantomjs-error-loading.html
Auto configuration failed
139998593603520:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(libproviders.so): libproviders.so: cannot open shared object file: No such file or directory
139998593603520:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
139998593603520:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=providers, path=providers
139998593603520:error:0E076071:configuration file routines:MODULE_RUN:unknown module name:conf_mod.c:222:module=providers```

I had the same issue and fixed it by setting export OPENSSL_CONF=/dev/null prior to phantomJS usage. If it's not possible for you to disable openssl then you would have to pack you application with older OpenSSL version.
Explanation:
Ubuntu 22.04 uses the new OpenSSL version 3.0.2 instead of the older OpenSSL version 1.1.1 . These OpenSSL versions are not fully compatible, so this is why you see this error when PhantomJS tries to auto configure the SSL/TLS settings.

Above answer is little about as I am describing.
Step:1 First stop your node server then run this command in base directory.
Step:2 I suggest you to comment out the lines providers = provider_sectin in the
file/etc/ssl/openssl.cnf
Step:3 Start your application
Brief ref. https://github.com/nodejs/node/issues/43132

Related

<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)>

I did the manual installation on python 3.7.5 on Debian 8, when I will run the script I get this error:
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)>
I saw several questions here in the stackoverflow more regarding MacOS, In my case this error is in Linux.
I had the same issue. Here is what I found helped my problem.
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
Please see here for the original answer from markroxor. Hope it will help your problem as well.
I had
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)>
With python3 3.9.2-3, and other python related packages with the same, or similar, version. On Debian GNU/Linux 11 (Bullseye).
At first, using the suggested
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
managed to solve the problem. Though I do not know if, and which, down sides, or other side effects, this solution has.
Afterwards, I noticed the /etc/ssl/certs/ folder is empty. Installing the ca-certificates package fills in this folder. Which seem to be another solution, in which those 2 python ssl lines are not required. You can see here the detailed list of files the ca-certificates package installed. This article, from 2015, with a last comment from 2017, discusses the location of ca-certificates in various OSs/distributions. I think the ca-certificates package is rather basic, and is usually installed as part of the initial installation of the machine. I do not know how it was missing from that particular machine.
What worked for my MacOs:
Open the finder
Find the version of Python that you are using
Open its folder
Click on the "Install Certificates.command". It will open a terminal and install the certificate.
In my case (Dell computer), the SSL problem was caused by Dell software itself:
reported here. In that case, according to this answer to another question in the SE network, you can solve the problem by running the following command:
sudo cp /usr/lib/x86_64-linux-gnu/libcrypto.so.3 /opt/dell/dcc/libcrypto.so.3
And then, run this:
sudo update-ca-certificates --fresh
It worked for me on a Dell Latitude 7310, LinuxMint21. November 2022.
THIS IS NOT A SOLUTION:
I have encountered that several times, note however that i'm using windows, but i would assume that generally the resolving mehtods should be the same in principle for mac/linux.
What i used to do is to force it to not verify the certificate by using the below:
conda config --set ssl_verify false
Note this is not a solution to the issue, it's just a way to make the code run temporarily, or if you're trying to download a library then that should do the trick until you download it. Note that the suggested below is not usually recommended, if you do it, after running your code/ downloading your library, remember to turn it back on using the below:
conda config --set ssl_verify true
If this happened after you installed a python version manually, inside the python app folder, double click on the "Install Certificates.command" file and it should fix it.

Cannot import Selenium even when it's installed [duplicate]

After searching the web for hours i didnt yet find an answer to my problem. I am using Python 3.6 and i cant import selenium. I always get the message "No module named 'selenium''
I tried everything, i first downloaded selenium from this website https://pypi.python.org/pypi/selenium/3.6.0 .
Then I tried python -m pip install -U selenium and didnt work either. I tried some other things that people said but they didnt work either.
Im using windows 10.
Any help?
As you mentioned you are using Python 3.6 following the steps :
Open Command Line Interface (CLI) and issue the command python to check if Python is properly installed :
C:\Users\username>python
Python 3.6.1 (v3.6.1:69c0db5, Jan 16 2018, 17:54:52) [MSC v.1900 32 bit (Intel)]
on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
Ensure pip is working properly :
C:\Users\username>pip
Usage:
pip <command> [options]
Commands:
install Install packages.
download Download packages.
uninstall Uninstall packages.
freeze Output installed packages in requirements format.
list List installed packages.
show Show information about installed packages.
check Verify installed packages have compatible dependencies.
search Search PyPI for packages.
wheel Build wheels from your requirements.
hash Compute hashes of package archives.
completion A helper command used for command completion.
help Show help for commands.
General Options:
-h, --help Show help.
--isolated Run pip in an isolated mode, ignoring environment variables and user configuration.
-v, --verbose Give more output. Option is additive, and can be used up to 3 times.
-V, --version Show version and exit.
-q, --quiet Give less output. Option is additive, and can be used up to 3 times (corresponding to WARNING, ERROR, and CRITICAL logging levels).
--log <path> Path to a verbose appending log.
--proxy <proxy> Specify a proxy in the form [user:passwd#]proxy.server:port.
--retries <retries> Maximum number of retries each connection should attempt (default 5 times).
--timeout <sec> Set the socket timeout (default 15 seconds).
--exists-action <action> Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.
--trusted-host <hostname> Mark this host as trusted, even though it does not have valid or any HTTPS.
--cert <path> Path to alternate CA bundle.
--client-cert <path> Path to SSL client certificate, a single file containing the private key and the certificate in PEM format.
--cache-dir <dir> Store the cache data in <dir>.
--no-cache-dir Disable the cache.
--disable-pip-version-check
Don't periodically check PyPI to determine
whether a new version of pip is available for
download. Implied with --no-index.
Install latest selenium through pip :
C:\Users\username>pip install -U selenium
Collecting selenium
Downloading selenium-3.8.1-py2.py3-none-any.whl (931kB)
100% |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 942kB 322kB/s
Installing collected packages: selenium
Successfully installed selenium-3.8.1
Confirm that Selenium is installed :
C:\Users\username>pip freeze
selenium==3.8.1
Open an IDE (e.g Eclipse, PyCharm) and write a simple program as follows :
from selenium import webdriver
driver = webdriver.Firefox(executable_path="C:\\path\\to\\geckodriver.exe")
driver.get('https://stackoverflow.com')
Execute the program on which Firefox Quantum Browser will be initiated and the url https://stackoverflow.com will be accessed.
Python Download Location (Windows) :
Python (for Windows) can be download from the following location :
https://www.python.org/downloads/
I'm on VS Code in Windows 10, and here's how I solved it.
You need to pay attention to where the Python is located (in my case),
1) C:\Users\_Me_\AppData\Local\Programs\Python\Python38\
and where the Python looks for libraries/packages, including the ones installed using pip (again, in my case),
2) C:\Users\_Me_\AppData\Roaming\Python\Python38\
I don't know why these two locations are different (gotta fix it at some point). It seemed that Python was running from the first location, but it was looking for libraries in the second!:/
Anyway, since I have limited experience in Python , I just copied the \Lib\site-packages from the first location (including selenium folders) to \site-packages in second one in hopes of solving the issue, which worked out for me!
How to check for there locations
1) Open Python CLI, typed the following command:
which python
2) Open Python CLI, typed the following commands (From this answer):
>>> import site
>>> site.USER_SITE
EDIT
Since this seems a temporary solution, I uninstalled Python and reinstalled it again in a proper directory (other than the default install directory), and now which python and which pip point to the same folder! Problem solved!
If these solutions did not work for you, try looking into which Python interpreter your IDE is using (in my case I was using VSCode - you can find the interpreter in the bottom bar). Worked for me.
Easiest way is to copy all files of "venv" Lib, Scripts, Selenium and other folder into your main project folder.
This issue occur as pycharm directly take from virtual environment venv.
Hope this will resolve your problem :)

Unable to activate Curl on Easyphp Devserver 16.1.1

I am trying to activate curl on my Easyphp Devserver 16.1.1, but I keep getting the error:
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-binaries\php\php5619vc11x86x160615094909\ext\php_curl.dll' - Impossibile trovare il modulo specificato [cannot open shared object file: No such file or directory].\r\n in Unknown on line 0
I did the following:
un-commented "extension=php_curl.dll" in both php.ini files
verified that the file php_curl.dll actually exists in extension_dir
copied libeay32.dll, libsasl.dll, ssleay32.dll to c:\Windows\System\, c:\Windows\System32\, c:\Windows\SysWOW64\
Downloaded cacert.pem from http://curl.haxx.se/ca/cacert.pem and added the full path to it on curl.cainfo in php.ini
Downloading various versions of curl from https://curl.haxx.se
Set paths to php directories in My Computer > Properties > Advanced > Environment Variables (eg: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-binaries\php\php5619vc11x86x160615094909\)
I rebooted after doing all these steps (specially for the step #6)
There are at least 5 similar questions, I followed every suggestion but nothing worked. Apache continues not to see my dll. Can anybody help on this issue?
Old topic but for people who land here and want skip all of the useless steps of Lucian.
Just use the answer from Anar Haziyev on this link:
Activation Curl on EasyPHP
work on easyphp devserver.
I faced the same issue with EasyPHP and what it fixed is that I had to install PHP as a different instance, not in the EasyPHP build and started the PHP service from the command line.

How to load Magritte Seaside?

I've loaded Magritte and Seaside from the configuration browser into Pharo 4, but I don't see that the package Magritte-Seaside was loaded.
How do I load this package?
I highly recommend you loading the Stephan's QCMagritte package which includes the correct directives to load Seaside 3 with a Zinc adaptor so you can start a web server without loading anything else:
From MinGW command line:
$ wget -O- http://get.pharo.org/40+vm | bash
$ ./pharo-vm/Pharo.exe Pharo.image config \
"http://smalltalkhub.com/mc/Pharo/MetaRepoForPharo40" \
"ConfigurationOfQCMagritte" --printVersion --install=stable --group=All
Create an adaptor, start a web server with the Seaside Control Panel on port 8080, and then point your browser to http://localhost:8080/browse to see applications
The configuration browser only loads default groups for the configurations it loads. In the ConfigurationOfSeaside and ConfigurationOfMagritte you'll find many more groups.
In the ConfigurationOfQCMagritte I use 'Seaside' from Magritte and #('JQueryUI' 'JQuery-JSON') from Seaside. If you don't mind the extra packages, you could just load QCMagritte from the configuration browser.
To just add the missing packages, you could load the latest Magritte-Seaside and Magritte-Pharo-Seaside packages from the Magritte3 smalltalkhub repository with the Monticello Browser.
A pre-loaded QCMagritte image is available from http:ci.inria.fr/pharo-contribution/job/QCMagritte
I saw the group Seaside defined as a Metacello group in the configuration's baseline for 3.3 (which is used by 3.5, the current version). So I was able to load the package by evaluating:
(ConfigurationOfMagritte3 project version: #stable) load: 'Seaside'.

Apache is "Unable to initialize module" because of module's and PHP's API don't match after changing the PHP configuration

php -v gives this
PHP Warning: PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options need to match in Unknown on line 0
PHP Warning: PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options need to match in Unknown on line 0
bogus test name tests/
ps. i've upgraded from php 5.2 to 5.3. before this everything worked okay.
When you update the version of PHP (especially when going from version X.Y to version X.Z), you must update the PHP extensions as well.
This is because PHP extensions are developped in C, and are "close" to the internals of PHP -- which means that, if the APIs of those internals change, the extension must be re-compiled, to use the new versions.
And, between PHP 5.2 and PHP 5.3, for what I remember, there have been some modifications in the internal data-structures used by the PHP engine -- which means extensions must be re-compiled, in order to match that new version of those data-structures.
How to update your PHP extensions will depend on which system you are using.
If you are on windows, you can find the .dll for some extensions here : http://downloads.php.net/pierre/
For more informations about the different versions, you can take a look at what's said on the left-sidebar of windows.php.net.
If you are on Linux, you must either :
Check what your distribution provides
Or use the pecl command, to re-download the sources of the extensions in question, and re-compile them.
just
pecl uninstall module_name
then
pecl install module_name
Your problem is within the php5-dev package. I guess you went from php5.2 on an older linux version to php5.3. I did the same thing, and when I managed to install php 5.3 there was a conflict with php5-dev. For some reason it doesn't get upgraded to the new version. Dunno why is that and I don't care, however this makes your extension compiled with the older API version, while php ofc is with the newer api version. What I did to solve this problem was:
I removed php5-dev with
sudo apt-get remove php5-dev, then I ran sudo apt-get autoremove to get rid of the leftovers that were giving me the trouble, and after that I just installed php5-dev again.
sudo apt-get install php5-dev.
Once that was done, I removed my memcache with sudo pecl uninstall memcache and installed it again sudo pecl install memcache. Now both the module and the php had the same api version so I knew right away that I had the issue solved :)
Hope it helps.
It's possible that the modules are installed, but your PHP.ini still points to an old directory.
Check the contents of /usr/lib/php/extensions. In mine, there were two directories: no-debug-non-zts-20060613 and no-debug-non-zts-20060613. Around line 428 of your php.ini, change:
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"
to
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626"
Then restart apache. This should resolve the issue.
I struggled with this issue for a long time and found out that when you run configure, just pass it the path to the correct php-config tool.
In my case, it was
./configure --with-php-config=/usr/local/zend/bin/php-config
... If you're unsure, run a locate php-config on your machine and find the right one amongst the different versions installed.
Hope this helps somebody in the future.
PS. My default php-config was set to 20090926 which is PHP 5.3. The one I manually entered as a param for ./configure was for PHP 5.4 (2010...)
I had this part enabled in my php.ini
extension=php_memcache.dll
[Memcache]
memcache.allow_failover = 1
memcache.max_failover_attempts=20
memcache.chunk_size =8192
memcache.default_port = 11211
After commenting these lines composer was installed in my windows 10
I had a similar issue after upgrading from PHP 5.5 to PHP 5.6. The phpize and php-config libraries being used to compile the phalcon extension were still the ones from PHP 5.5. I had to run the command below:
sudo apt-get install php5.6-dev
There will be a long stacktrace, the key information I saw was this:
update-alternatives: using /usr/bin/php-config5.6 to provide /usr/bin/php-config (php-config) in auto mode
update-alternatives: using /usr/bin/phpize5.6 to provide /usr/bin/phpize (phpize) in auto mode
I hope this helps someone.
Before you phpize, make sure to update your path ($PS1) to point to the new PHP! phpize uses your environment, and if you still have vestiges of your old PHP in your path or other parts of the environment, things will get hairy!
I'd the same error even after recompiling the modules.
But I solved it you just have to specify the absolute path of your phpize.
Here is the one that works with php 5.5. Download xampp 1.8.3 from here and download memcache dll from here
In my case in php.ini
[CLDbg]
extension=php_cl_dbg_5_3_VC9.dll
clport=6000
I removed Codelobster which support different PHP version, so need to update to:
[CLDbg]
;extension=php_cl_dbg_5_3_VC9.dll
;clport=6000
This problem has just happened to me and has been solved simply by increasing
memory_limit from 32 M to 64 M
You can adjust the value on the file where php.ini exists
locate php.ini
then choose the right file and search for memory_limit and after modifying it
you must reboot the apache
/etc/init.d/httpd restart
All the best.
In my case, I used lnmp to install php with version 5.4.45. But maybe because I installed php5-dev after lnmp (which I guess is not necessary if you installed lnmp), my phpize and php-config both point to older version tools than php.
I solved this by change the soft link of /etc/alternatives/phpize and /etc/alternatives/php-config to /usr/local/php/bin/phpize and /usr/local/php/bin/php-config.
Hopes this is helpful.
What worked for me was simply to do the following:
open the php.ini file.
Under the DYNAMIC EXTENSIONS heading, comment out the following line as
;extension=php_java.dll
Restarted Apache and all was fine