I'm attempting to install the Trader extension on my mac. I believe the install was done correctly but can't seem to use them. Here is my feedback from terminal
sudo pecl install trader
pecl/trader is already installed and is the same as the released version 0.4.0
install failed
Based on that it shows that I have installed it. But here is what I get when trying to use one
Uncaught Error: Call to undefined function trader_cci()
Anybody have tips on a step I may have missed?
Thanks in advance!
Did you include the extension in your php.ini file? You will need to add the following line in the correct ini (depends on if you use it on the command line or via FPM) to tell PHP that it needs to load the installed extension
extension=trader.so
Related
I uploaded my Laravel project to server. It displays following error. How to fix it?
Fatal error: Call to undefined function Symfony\Polyfill\Mbstring\iconv_strpos() in /home/invoice/vendor/symfony/polyfill-mbstring/Mbstring.php on line 358
Did you install iconv PHP extension. If not please install and enable it. This may fix your problem. Please see the Documentation. Here is the Link.
You need to install iconv extension.
You need to make sure that php-iconv and php-mbstring are installed on the server. By default, mbstring is not installed on cPanel/WHM servers
Easiest way is composer require symfony/polyfill-iconv
You need the polyfill package. You can download the polyfill package with composer or you go on this site and download it without composer.
My project works fine on localhost but not working online and this is the error:
Fatal error: Call to undefined function Symfony\Polyfill\Mbstring\iconv_strlen() in /home/stram/public_html/vendor/symfony/polyfill-mbstring/Mbstring.php on line 338
I googled it and I found that I need to install the PHP extension iconv. The problem that I'm using a VPS and when I went to the list of available PHP extensions I didn't found this extension !
Thnx in advance.
Symfony provides an iconv-polyfill for cases like that. Just add it as requirement to your project, and you should be fine:
composer require symfony/polyfill-iconv
It may also happen that you are using an outdated version of PHP, or one that was compiled without iconv.
To check that, run php --ri iconv with any SSH software, like Putty, etc.
If it shows Extension 'iconv' not present., your problem is in PHP. Then you have a few options:
Run php -v to check your PHP version, and update it if necessary
Or compile PHP again with iconv
Or enable iconv on WHM/cPanel, if you use them
Or ask your hosting company for support
Here is a solution to your problem (command line is for CentOS) :
If you use WHM with the CentOS 7 operating system you will encounter errors like this when typing "composer" on the console:
Fatal error: Uncaught Error: Call to undefined function Symfony\Polyfill\Mbstring\iconv() in phar:///opt/cpanel/composer/bin/composer/vendor/symfony/polyfill-mbstring/Mbstring.php:661
Stack trace:
0 phar:///opt/cpanel/composer/bin/composer/vendor/symfony/polyfill-mbstring/bootstrap.php(48): Symfony\Polyfill\Mbstring\Mbstring::mb_strwidth('help', 'ASCII')
......
The solution is to install the iconv package using WHM:
Enter to your WHM then type "EasyApache 4" then click "EasyApache 4" and click "Customize". you can see in the picture
EasyApache 4
Select PHP Extensions, type "iconv" in the search and check the version of php that you will use to install the iconv package. see in the picture
PHP Extensions
Choose Review
Review
Click Provision
Provision
To ensure that the iconv package is installed you can use this command "php --ri iconv" if the results are like this in the picture. then the iconv package has succeeded. try typing the composer again so you don't get any more errors
php --ri iconv
Solved: If you are using Cpanel/WHM STACK then follow:
Go to WHM >> EasyApache4 >> Current Installed Packages >> customize
Now Select php extensions and search for iconv and debug install both of them and try to install again.. enjoy :)
I had the same error message when I installed Mbstring extension but did not restart Apache.
All that needed is to do
$ sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper restart
Yeah, I have a long path here, but it is just for me. It is because I use MacPorts
To find your Apache location use
$ ps ax | grep apache
P.S.
I don't have iconv extension installed too. At list it is not listed when I call php info like so:
die(phpinfo());
BTW
it is really easy to install extension with MacPorts, For my PHP 5.6 I have done just:
$ sudo port install php56-mbstring
So I have already installed Apache2 and Mysql on Linux Mint (the same as Ubuntu), Now I am trying to install PHP on Apache but I get a very strange error message :
configure: error: Cannot find php_pdo_driver.h.
I did some search on the Internet and I found out that these files were not embedded before in PHP, but they are now. I even checked for it myself in the PHP source folders and I found that specific file. Can anyone tell me what's the problem and how to solve it ?
actually PDO is included on PHP core.
You must install the PHP and MySQL bundled packages.
Use sudo apt-get install php5-mysql
you should check your php version, you must have php version 5 to load PDO.
My idea is to use reactjs with serverside rendering in PHP. I run and install with success php55-v8js using homebrew. the path of installation is /usr/local/Cellar/php55-v8js/0.4.0_2
in my application I tried to use V8 but with no success. the message displayed is:
Fatal error: Class 'V8Js' not found in
/Applications/AMPPS/www/phpreact/index.php on line 14.
on line 14 the following code is displayed: $v8 = new V8Js();
my main question is: do we have to call v8 through a require_once/file_get_contents->toPath or similar? or homebrew installation make v8 available globally on the OS system?
If you installed the V8 PECL extension correctly, you also need to turn on the extension in your .ini file and restart your PHP server.
I'm trying to install Magento on FreeBSD with PHP 5.3.20, but the install script fails with
Fatal error: Call to undefined function hash() in /var/www/.../magento/lib/Zend/Cache/Backend/File.php on line 894
As it's cleared in another StackOverflow question it requires PHP 5.1.2, so that's a different problem. I installed the php5-mhash extension from ports and added mhash.so and hash.so to the extensions.ini. Also, there is no --disable-hash in the configure command. And it's the same in CLI too.
Probably because open_basedir? Any ideas?
Try installing it from security and see if this will work for you.
cd /usr/ports/security/php5-hash
make install clean