I'm running ArchLinux 64bit, I'm trying to create a Clickstack to run Symfony on Cloudbees.
I've created a Clickstack that extends PHP-ClickStack
When trying to test the bundled PHP I get the following error:
php: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory
I've downloaded and installed LibPng15 to /usr/local/.
I've also copied that file to: /path/to/php/lib/, /path/to/php/include/, and /path/to/php/bin/. It hasn't fixed the error.
I've also downloaded tried downloading the source for PHP-5.4.24 and 5.5.8 but, when I compile them they both some of the Intl tests.
So how can I get a working binary version of PHP that I can upload to Cloudbees?
The solution was to create LD_LIBRARY_PATH as an environment variable in script.
Apparently it didn't exist.
LD_LIBRARY_PATH=/usr/lib:/usr/local/lib/:/path/to/libpng/
NOTE: adding the normal directories prevents other tools/apps from breaking.
Related
I am trying to create a simple symfony project.
I run this on console:
composer create-project symfony/skeleton myProjectName
php -S 127.0.0.1:8000 -t myProjectName/public
Project succesfully run at localhost:8000. However, when I begin to inspect the code, I realized VS Code editor is indicating "Undefined type" error in projectDirectory/src/Kernel.php file. Do you have any ideas why this happens and any suggestions towards solution?
I use PHP v7.4.32 and Symfony 5.4 for development. My helper extentions are PHP Intelephense v1.8.2 and PHP IntelliSense v1.0.11.
projectDirectory/src/Kernel.php
The Error
Since it runs succesfully on browser, I dubted that the classes exist somewhere but the VSCode could not solve the relative paths. Then, I tried a couple of extensions. Installation of PHP v1.22.11089 created by DEVSENSE and PHP Namespace Resolver v1.1.9 created by Mehedi Hassan has solved the problem.
I installed the MongoDB PHP driver on Windows 10 (I'm using WAMP equipped with PHP 5.6.25. following the istructions I found at http://php.net/manual/en/mongodb.installation.windows.php and I installed also the libbson and libmongoc libraries (requested as requirements) as written at http://php.net/manual/en/mongodb.requirements.php.
Then, I added the bin folders of MongoDB, libbson and libmongoc to system path.
However, even if I can see the php_mongodb extension in the extensions list of WAMP, launching phpinfo() the mongo extension doesn't appear with the others.
Furthermore, tryng to connect to my database with
<?php
$mongo=new MongoClient("");
$db=$mongo->galileo;
$collection= $db->items;
print_r("Number of documens: "); ?>
I got the error
Fatal error: Class 'MongoClient' not found in C:\wamp64\www\galileo\index.php >on line 21
At a first look, reading this error, it might seem like that PHP is looking for php_mongodb extension in the uncorrect folder i.e. C:\wamp64\www\galileo\index.php (where the index page of my project is placed) instead of the correct one C:\wamp64\bin\php\php5.6.25\ext where all the extensions are.
But, looking at php log file php_error.log I find also a warning that says:
PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp64/bin/php/php5.6.25/ext/php_mongodb.dll' - Il sistema operativo non pu� eseguire %1.
in Unknown on line 0.
(for not Italian speaking, the phrase after - means the operating system can't execute %1, even if I can't imagine what %1 stands for).
Even using the new class MongoDB\Driver\Manager I get the error
Fatal error: Class 'MongoDB\Driver\Manager' not found in C:\wamp64\www\galileo\index.php on line 21
and the same warning.
Do you notice some error or forgetfulness in the installation process as I described and, if not, do you know how to fix the problem?
The problem is certainly related to WAMP and I think is related to the multiple php.ini in his folders. In fact, in the apache folder you can find a php.ini file that cannot be modified, otherwise nothing works at all; at the same time any changes made to the php.ini file in the php folder seems have no effect except making appear the mongodb extension in the extensions list.
So, I try using XAMPP, as suggested in this video tutorial and it works. Using Composer I was able to install also the PHP library and not only the driver.
you should not use 'MongoClient class' anymore, this extension that defines this class is deprecated. look at here.
instead, you should use MongoDB\Driver\Manager class. please read http://php.net/manual/en/class.mongodb-driver-manager.php.
and the setup must be like this in php:
$mongo = new MongoDB\Driver\Manager("mongodb://localhost:27017");
And if you still use the old class; you either need to install the old legacy extension (pecl install mongo) and use PHP 5.x, or update your code to use this new driver's classes as the old driver is not available for PHP 7. There is an upgrade guide at here.
the last part is from derickr's answer in this issue on github: https://github.com/mongodb/mongo-php-driver/issues/300
This is a bit of a weird one, so please bear with me.
I'm trying to get Bugsnag up and running on our custom platform.
The boilerplate code looks like:
if ( !include_once($NP->settings->paths->external .'/Bugsnag/guzzle.phar') )
exit('Failed to load ERROR: guzzle');
if ( !include_once($NP->settings->paths->external .'/Bugsnag/bugsnag.phar') )
exit('Failed to load ERROR SYSTEM: bugsnag');
This unfortunately throws an exception:
Fatal error: require(): Failed opening required 'phar://guzzle.phar/autoloader.php'
However, if I attempt to load this outside of our platform, it seems to spin up just fine.
As I am not thoroughly familiar with the ins and outs of working with phar's, what could we be setting which would interfere with a phar's ability to reference inside it's own container?
Information:
Ubuntu 16.04.2 LTS
PHP 7.0.18-0ubuntu0.16.04.1 (Phar is native)
Phar EXT version: 2.0.2
Phar API version: 1.1.1
Phar-based phar archives: enabled
Tar-based phar archives: enabled
ZIP-based phar archives: enabled
gzip compression: enabled
bzip2 compression: disabled
Native OpenSSL support: enabled
phar.readonly: On
phar.require_hash: Off
Any assistance will be appreciated.
Thanks!
UPDATE: After doing some testing with a colleague, I noticed that even putting the boilerplate code at the very top of our primary platform boot script, still threw the error. The only thing we could think of which changes in that case is a directory change (as the boot script is in the include_path). After adding the external directory to php's include_path, it seemed to work. I am confused by this however, because it is my understanding that Phar files are self-contained to specifically not have issues like this. Why would a Phar file suddenly be unable to reference itself, after it has already be successfully included?
UPDATE: So, the above update is not an actual fix. The results are very strange. It will spin up fine one time, then fail the next few times. Again, this is when there is no other code loading before it. Something interesting: If we restart Apache, it loads on the first page load. Everything after that it fails.
Is guzzle.phar a symlink to a file with a different name?
Otherwise you can break internal linking in .phar files by setting a different alias when loading them through the Phar class:
new Phar('guzzle.phar, 0, 'differentalias.phar');
Not sure, but I think you cannot reference a PHAR from inside another PHAR.
Why not use a usual setup with Composer (to install all the deps) and then create a PHAR using Box project?
I'm trying to use the informix pdo driver but I always get the following error:
"could not find driver"
I'm using the Microsoft IIS with PHPManager and PHP version 5.3.5. The php_pdo_informix.dll is located in the correct folder and enabled in the php.ini
Are there any ideas where the problem lies?
I don't use PHP nor pdo drivers, but you can use Process Monitor by SysInternals/Microsoft to see if php_pdo_informix.dll is loaded.
Often Informix drivers do not load, because some environment variables are not set. Especially INFORMIX_DIR, CLIENT_LOCALE, DB_LOCALE, SERVER_LOCALE, DBLANG. Do you have Informix Client installed? Are you able to set up and test ODBC connection?
You can also add directory with php_pdo_informix.dll to PATH.
EDIT:
I downloaded php_pdo_informix.dll and it seems that this file is broken. I tested it with my Python utility to check dll libraries: http://code.activestate.com/recipes/576522-searching-dll-and-exe-files-in-path/
c:\download>which_dll.py php_pdo_informix.dll
2011-03-04 08:03:45 32833 [b] c:\download\php_pdo_informix.dll
ver:5.2.5.5
trying to load "php_pdo_informix.dll" ...
Cannot load "php_pdo_informix.dll" !!!
And MessageBox appeared (translation from Polish)
---------------------------
python.exe - Bad image file
---------------------------
Aplication or libarary DLL c:\download\php_pdo_informix.dll is not correct image of Windowns NT. Check it with install disc.
---------------------------
OK
---------------------------
SHA1 sum of library I downloaded:
b38bc54839c7c4b82e2057763ef1c6584dcbbb1f *php_pdo_informix.dll
If your PHP is VC9, try this:
php_pdo_informix_PHP5.3_VC9.zip
I had this problem, and I solved by installing the CSDK from IBM to get the php_pdo_informix.dll to work, you can download it from http://www14.software.ibm.com/webapp/download/search.jsp?rs=ifxdl
I just try to integrate ImageMagick into my PHP project. I installed and just execute the sample files that they provided with the imagick-3.0.0RC1 zip file. But it shows
Fatal error: Class 'Imagick' not found in C:\wamp\www\imagick-3.0.0RC1\imagick-3.0.0RC1\examples\watermark.php on line 9
this kind of an error how can I avoid that. I cant see any class including section on that page. How to include the class files.
You need to install the ImageMagick PHP extension. According to the manual there is no prebuilt extension for Windows so you'll probably have to configure and compile it yourself.