Fatal utf8_strpos error - joomla

I am receiving the following fatal error on my Joomla 2.5 website: Fatal error: utf8_strpos: Offset must be an integer in /path/to/file/libraries/phputf8/native/core.php on line 66. I recently moved my website to a new host (dedicated Rochen Hosting server) and that is when the error started appearing. The fatal error never appeared on the old hosting provider. I have also been receiving a blank white index.php page intermittently when the website loads, but all of the other pages load with no problem. I am not sure if this issue would be related to the fatal error.
Any assistance with this issue would be greatly appreciated.
Thank you.
Mike
Joomla 2.5.4
PHP 5.3.10
MySQL 5.1.61
Apache 2.2.22
Custom Joomla template

Is your current PHP version compatible with the library?

It's because the package php-mbstring isn't installed. Try sudo yum install php55-mbstring then service httpd restart.

Related

Laravel error - Class setEventDispatcher does not exist

Short version
I'm getting this error, when I run php artisan serve and visit my home page:
ReflectionException (-1)
Class setEventDispatcher does not exist
Details
Laravel version: 5.6.39
Environment: local
OS: macOS Mojave 10.14.2
It started, when I got an error using npm (in another project), so I reinstalled Node (this way).
After doing that, then this project (in question) couldn't be started. I was getting this error, when running php artisan serve:
dyld: Library not loaded: /usr/local/lib/libpng16.16.dylib with anything php related
Referenced from: /usr/local/bin/php
Reason: image not found
That error was resolved by updating and upgrading brew.
Then I was capable of starting the project (php artisan serve). But when I visit the home page, this error was shown:
ReflectionException (-1)
Class setEventDispatcher does not exist
If I follow the stack trace, then I can see that it was this line (from my homeController) that triggered the error:
if( ! Auth::check() ){
return view( 'pages.home' );
}
If I commented that out, then the same error occured from another place, where the Auth-module was being used.
Here's the stack trace:
Does anyone know how to resolve this? I can't find any promising results on Google, - and I have no idea why this happens... :-/
Addition1
I tried composer clear-cache and deleting the vendor-folder, and then doing a composer install and the problem still occured.
I also checked my Service Providers, as Marcus suggested, - but I don't really know what to look for in there. It all looks pretty regular (no fancy if-statements or anything).
Addition2
I realized, that I couldn't connect to my database using Sequel Pro. And it was because Brew had updated my MySQL-version from 5.5 to 8.0.
That was resolved by doing something along these lines (I did a bunch of stuff, so I might be missing a coulple of steps):
brew unlink mysql
brew install mysql#5.7
brew switch mysql 5.7.21
brew link mysql
and I could then verify the version with mysql --version. I also had some permission issues with that MySQL-version-change, but I'm emitting that, so this doesn't get too long.
Addition3
I tried disabling the Laravel Debugbar (by deleting it from composer.json, deleting composer.lock and vendor and then running composer install). And that fixed it!! ... But!
When I later tried to install Barryvdh's IDE Helper, then the exact same error came back!?
I performed these three steps, to install the IDE Helper (and re-introduce the error):
Run this command from the root of my directory: curl https://gist.githubusercontent.com/barryvdh/5227822/raw/4be028a27c4ec782965bb8f2fdcb4c08c71a441d/_ide_helper.php -o _ide_helper.php
Add these lines to app/Provider/AppServiceProvider.php:
...
if ($this->app->environment() !== 'production') {
$this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
}
Run this command: composer require --dev barryvdh/laravel-ide-helper
So I'm back at this error:
ReflectionException (-1)
Class setEventDispatcher does not exist
... The stack trace is identical to the one shown previously (sprung from Container.php).
Tried every solution, none of them worked.
Finally, i realised that when trying to upgrade php to 7.3.3 it was infact a network error that caused the fail. Read the logs, tried again, restarted valet and tried again.
It works now.
Upgrading to 7.3.3 was the solution indeed.
Thank you!
So this is what usually fixes it for me
Reinstall composer dependencies by removing vendor folder and composer.lock. Then run composer clear-cache and then composer install (this is usually the problem)
Check that all service providers are imported correctly in app.php under directory config
Make sure that your service providers are not importing something that does not exist, for example if you register a service provider in production but is only installed as dev:
if (env('APP_DEBUG')) {
$app->register(Barryvdh\Debugbar\LumenServiceProvider::class);
}
If you use valet, I solved it running
valet restart and all works fine.
cheers!
The fix for me was to update PHP to 7.3.3 and then restart valet. Apparently this was a bug with php 7.3
https://github.com/laravel/framework/issues/27052
Hope this helps
I got some idea... I've just run into this problem after reconfiguring my apache virtual host ports, so I restarted apache/httpd again, and the problem went away. Might it be related with the server environment?
I am facing the same issue in mac book pro. My system configuration is PHP 7.3, MySQl and I use SQL Pro. I have implemented all the above methods but nothing gets worked.
The issue is still a mystery for me but for temporary I have solved this issue using
artisan command as bellow.
php artisan serve
Its Allow me to run the project on http://localhost:8000
Hope this can help to solve this issue.
Try to restart PHP. When I reboot my Mac, then this happens. After restarting PHP everything starts to work.
sudo brew services restart nginx

Uncaught ErrorException: preg_match_all(): JIT compilation failed: no more memory

I just upgraded my PHP on macOS from 7.2 to 7.3 and while trying to run composer update on a project of mine, I get the error;
PHP Fatal error: Uncaught ErrorException: preg_match_all(): JIT compilation failed: no more memory
I've run a few Google searches; it looks like the issue is new, and I couldn't find any working documentation online.
Is this an issue related to PHP 7.3 and Composer? If so, how do I resolve it? Thanks for your help in advance.
If pcre.jit = 0 pcre.jit=0 pcre.jit = Off in php.ini, not worked, try this:
I suppose you installed php 7.3 through homebrew.
If so, create a zzz-myphp.ini in /usr/local/etc/php/7.3/conf.d with the following content:
; My php.ini settings
; Fix for PCRE "JIT compilation failed" error
[Pcre]
pcre.jit=0
If this also doesn't work, uninstall php7.3 and install 7.2 or 7.1
brew uninstall php#7.3
Edit the following file
/usr/local/etc/php/7.3/php.ini
Find and change the pcre.jit variable
pcre.jit=0
If the issue remains
Try restarting your computer.

composer on the cpanel v68.0.29

Server running WHM/cPanel v68. As composer is now included globally with cpanel, I'am login SSH as a cpanel user and try to use composer, but nothing happens:
host#host [~]# composer --help
host#host [~]# composer diagnose
host#host [~]#
on another server with the same version of the Cpanel and CloudLinux, it's all right. What could be the reason? The version of php set to 7.1 with PHP Selector. Directive
allow_url_fopen On
are chosen in CPanel (as reccomended in documentation).
Unfortunately for the first time I try to use a Composer, I do not understand what it needs.
Update:
composer -V
Fatal error: Class 'Phar' not found in /opt/cpanel/composer/bin/composer on line 23
The error that you're seeing at the bottom -
Fatal error: Class 'Phar' not found in /opt/cpanel/composer/bin/composer on line 23
.. this means that the phar PHP extension is not loaded. If your cPanel is hosted on a CloudLinux environment you can see if you can enable it from
cPanel -> Select PHP Version -> Enable Extension
if not - you need to contact your hosting provider to see if they can enable it for you.

Error 'Class undefined: Zend_Cache' when install Magento on HHVM and Nginx

I want to install Magento 1.9.2.1 on my server with Nginx, HHVM & MySQL.
I managed to install & configure Nginx, HHVM & MySQL to work. With the latest source code of Magento version 1.9.2.1, I put it in the root folder of my site, then access the domain to start installing Magento as usual.
The problem is when I go to the site, it's blank instead of redirecting to the installation process.
Checking the error log in /var/log/hhvm/error.log, there is an error:
Fatal error: Class undefined: Zend_Cache in
/var/www/html/app/code/core/Mage/Core/Model/Cache.php on line 137
Normally I think it should be included automatically by autoloading?

Magento connect : Connection Error try again later

I am trying to install one extension using magento connect but the error I am getting :
Connection Error try again later.
I am using extension key
http://connect20.magentocommerce.com/community/Mageix_ExtensionManager
I was just hit with this error - turns out the live server I had just moved the site too didn't have DOMDocument support in PHP. A quick yum install php-xml and restart of Apache fixed it!
Check the compatibility of the extension
Flush the cache in magento connect and check
Installing yum install php-xml and restarting nginx worked for me.

Resources