EasyPHP Devserver and PHPMyAdmin 5.1.1 - Composer dependencies issue: openssl - php

Getting the following message when attempting to run PhpMyAdmin 5.1.1 within EasyPHP Devserver 17. This is with MySQL 8.0 and PHP 7.4:
Composer detected issues in your platform: Your Composer dependencies require the following PHP extensions to be installed: openssl
I have checked the php.ini and it contains extension=openssl without comment.
Full results from php -i cmd on my Windows 10 machine.
UPDATE
The above error is produced when attempting to open PhpMyAdmin 5.1.1 from EasyPHP Devserver dashboard.
Also, php -i cmd shows:
Configuration File (php.ini) Path =>
Loaded Configuration File => E:\Projects\PHP Migration\EasyPHP-Devserver-17\eds-binaries\php\php7427vc15x86x220629181102\php.ini
...
openssl
OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 1.1.1l 24 Aug 2021
OpenSSL Header Version => OpenSSL 1.1.1l 24 Aug 2021
Openssl default config => C:\Program Files (x86)\Common Files\SSL/openssl.cnf
Directive => Local Value => Master Value
openssl.cafile => no value => no value
openssl.capath => no value => no value
C:\Program Files (x86)\Common Files\SSL/openssl.cnf does not exist. I guess that might be a problem?
The same error occurs with this PHP script:
if (!(PHP_VERSION_ID >= 70103)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.1.3". You are running ' . PHP_VERSION . '.';
}
$missingExtensions = array();
extension_loaded('hash') || $missingExtensions[] = 'hash';
extension_loaded('iconv') || $missingExtensions[] = 'iconv';
extension_loaded('json') || $missingExtensions[] = 'json';
extension_loaded('mysqli') || $missingExtensions[] = 'mysqli';
extension_loaded('openssl') || $missingExtensions[] = 'openssl';
extension_loaded('pcre') || $missingExtensions[] = 'pcre';
extension_loaded('xml') || $missingExtensions[] = 'xml';
if ($missingExtensions) {
$issues[] = 'Your Composer dependencies require the following PHP extensions to be installed: ' . implode(', ', $missingExtensions);
}
if ($issues) {
echo 'Composer detected issues in your platform:' . "\n\n" . implode("\n", $issues);
exit(104);
}
Any ideas how to fix this?

Related

phpmyadmin error when installing in arch linux

i have tried installing phpmyadmin on arch linux but every time i open localhost/phpmyadmin,i get this text.
PHP 7.2.5+ is required.
Currently installed version is: ' . PHP_VERSION . '
'); } // phpcs:disable PSR1.Files.SideEffects define('PHPMYADMIN', true); // phpcs:enable require_once ROOT_PATH . 'libraries/constants.php'; /** * Activate autoloader */ if (! #is_readable(AUTOLOAD_FILE)) { die( '
File ' . AUTOLOAD_FILE . ' missing or not readable.
' . '
Most likely you did not run Composer to ' . '' . 'install library files.
' ); } require AUTOLOAD_FILE; global $route, $containerBuilder, $request; Common::run(); $dispatcher = Routing::getDispatcher(); Routing::callControllerForRoute($request, $route, $dispatcher, $containerBuilder);
i have installed php and this its version
PHP 8.1.8 (cli) (built: Jul 9 2022 06:10:37) (NTS)
i have also tried following all the steps in arch documentation (https://wiki.archlinux.org/title/phpMyAdmin)
but when i try to open the url(localhost/phpmyadmin),it outputs a blank page with no
body so i had to reset all the configs to default.help me out.thanks alot
to solve this issue,i reinstalled everything again,followed the steps in (https://wiki.archlinux.org/title/phpMyAdmin) and in /etc/php/php.ini,uncommented the extension 'bz2 and mysqli'

define ffmpeg binaries path dynamically in php depending on OS

I'm trying to define the ffmpeg binaries path dynamically in php depending on OS...
Here's my code:
// Check if OS is Windows
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$OS = 'win';
// 'This is a server using Windows!';
}
require ABSPATH . '/vendor/autoload.php';
if($OS == 'win')
{
$ffmpegpath = ABSPATH . 'FFMpeg/bin/ffmpeg.exe';
$ffprobepath = ABSPATH . 'FFMpeg/bin/ffprobe.exe';
}
$ffmpeg = FFMpeg\FFMpeg::create(array(
'ffmpeg.binaries' => $ffmpegpath,
'ffprobe.binaries' => $ffprobepath,
'timeout' => 3600, // The timeout for the underlying process
'ffmpeg.threads' => 12, // The number of threads that FFMpeg should use
));
For some reason it doesn't work.
If I hard code the same paths within the ffmpeg construct function it does work.
Any ideas?
Thanks.
Nevermind, I found the problem, it was a pesky little GLOBAL var bug in my code.
Apologies for the question, I can't delete it.
Thanks.

Installing pThreads in Windows

Can anyone guide me in installing pThreads in Windows .
Actually i want to enable Threads in PHP .
require_once( 'Thread.php' );
// test to see if threading is available
if( ! Thread::available() ) {
die( 'Threads not supported' );
}
// function to be ran on separate threads
function paralel( $_limit, $_name ) {
for ( $index = 0; $index < $_limit; $index++ ) {
echo 'Now running thread ' . $_name . PHP_EOL;
sleep( 1 );
}
}
// create 2 thread objects
$t1 = new Thread( 'paralel' );
$t2 = new Thread( 'paralel' );
// start them
$t1->start( 10, 't1' );
$t2->start( 10, 't2' );
// keep the program running until the threads finish
while( $t1->isAlive() && $t2->isAlive() ) {
}
Error displaying is "Threads not supported."
My PHP version 5.3.4 .
Install ZTS (thread safe) PHP (obligation)
http://windows.php.net/downloads/releases/php-5.5.6-Win32-VC11-x86.zip
Download Pthread and install
http://windows.php.net/downloads/pecl/releases/pthreads/
Move php_pthreads.dll to the php\ext\ directory.
Move pthreadVC2.dll to the php\ directory.
enter extension=php_pthreads.dll to php.ini
try examples
https://github.com/krakjoe/pthreads/tree/master/examples
The code you have posted is not compatible with pthreads.
Windows binaries for pthreads are available http://windows.php.net/downloads/pecl/releases/pthreads/
Simply download the release, unpack the extension dll (php_pthreads.dll) to your extension directory and the runtime dll (pthreadVC2.dll) to your php directory (same dir as php.exe) and add extension=php_pthreads.dll to your configuration
Example pthreads code can be found on github http://github.com/krakjoe/pthreads

command line combine pdfs through php exec

I just setup wkhtmltopdf to take html docs and turn them into pdfs but now I need a way to combine the multiple pdfs.
Any suggestions?
We do have pdflib license if there is something it can do but seems its mainly an api for custom building pdfs.
If you got wkhtmltopdf I suppose you're using Linux and you got a root shell access.
You could use Pdftk Toolkit via system() or exec().
First install it. It's a package in Debian/Ubuntu, for example:
sudo apt-get install pdftk
Then make sure that's visible in your bin search PATH.
And a simple PHP snippet:
// In / Out filenames
$input_files = array( 'file_one.pdf', 'file_two.pdf' );
$file_out = 'merged.pdf';
// Escape names and create argument
$line_parts = '';
foreach( $input_files as $file ) {
$line_parts .= escapeshellarg( $file ) . ' ';
}
// Run pdftk
$cmd = 'pdftk ' . $line_parts . ' cat output ' . escapeshellarg( $file_out );
system( $cmd, $retval );
if( $retval ) { print 'There was an error!'; }

Connect to remote afp server using PHP

I'm trying to make a php script to connect to an afp server and get a directory listing (with each file size). The server is local in our office, but I'm unable to just make a script on the afp server side. On my machine, I use something like this:
$filesInDir = array();
$filesInMySQL = array();
if (is_dir($uploadDir)) {
$dh = opendir($uploadDir);
if ($dh) {
$file = readdir($dh);
while ($file != false) {
$path = $uploadDir . "/" . $file;
$type = filetype($path);
if ($type == "file" && $file != ".DS_Store" && $file != "index.php") {
$filesInDir[] = $file;
}
$file = readdir($dh);
}
closedir($dh);
} else {
echo "Can't open dir " . $uploadDir;
}
} else {
echo $uploadDir . " is not a folder";
}
But I can't connect to the afp server. I've looked into fopen it doesn't allow afp, and I don't think it'd allow directory listing:
opendir("afp://ServerName/path/to/dir/");
Warning: opendir() [function.opendir]: Unable to find the wrapper "afp" - did you forget to enable it when you configured PHP? in...
Warning: opendir(afp://ServerName/path/to/dir/) [function.opendir]: failed to open dir: No such file or directory in...`
I'm not looking to see if a file exists, but to get the entire directory listing. Eventually I'll also have to remotely copy files into an output directory.
eg.
mkdir afp://ServerName/output/output001/
cp afp://ServerName/path/to/dir/neededfile.txt afp://ServerName/output/output001/
Maybe use http://sourceforge.net/projects/afpfs-ng/ to mount it...
I'm developing on an Mac Mini, so I realised I could just mount the afp share, and use readdir. I had to mount the drive using the following:
sudo -u _www mkdir /Volumes/idisk
sudo -u _www mount_afp -i afp://<IP>/sharename/ /Volumes/idisk/
Further details here

Categories