I just installed laravel for the first time
andi have php 8.1
I haven't touched anything yet and I have the following errors
I don't understand these errors without having touched a single line of code.
I tried to find solutions but I don't know what to do
Related
Trying to implement some php into my school's website assignment. unfortunately i do not know how to enable php in my vscode. i installed xampp n am running the apache module. php.exe is accessible but the setting.json is rejecting it. ive googled for some remedies but they havent worked out or my search wasn't through enough.
currently disabled my php extentions which include the intelephase, intellisense n debug as i thought they were causing some issues. but the error still persists. appreciate it.
sorry if my terminology is not accurate.
a few weeks back I setup PHP 8 but hit some issues in projects so reverted back to 7.4.
However, a few of my projects are broken and the errors I'm getting all seem linked to PHP 8.
An example is "Fatal error: Uncaught ArgumentCountError: array_merge()"
This is on a WordPress project that even with default theme and database from production is still throwing this issue when it wasn't before.
Running which php and php -v are both stating 7.4 as the PHP version.
Just checked and the phpinfo() page is still PHP 8.
Anything else I need to that might be causing this drama? I'm using Laravel Valet...
Might be useful to someone...
Turns out that Laravel Valet was caching it's .sock file...
rm ~/.config/valet/valet.sock
valet start
Did the job for me.
I've got a CakePHP 1.2-based web site (I know.. too ancient) that I need to upgrade only to whatever is the oldest Cake to support PHP 7.1 (I think roughly Cake 2.8, from what I've seen so far), because my host is upgrading PHP to 7.1 across the board. This site only needs to live maybe 1 more year before we totally replace it, but we don't have time to do that before the host upgrades PHP at end of year.
I am trying to get the web site as-is running in a vagrant VM, so I can go through the upgrade steps there, carefully, and understand exactly what I need to do. My problem now is that I can't get the site to display. More concretely, when I try to load the site with nginx in vagrant, I get nothing but a blank screen with a few PHP warnings (strict standards to the effect of Non-static method Configure::read() should not be called statically), but nothing obviously broken. There's basically nothing in the PHP log, and nothing in the Nginx log. Again, this is the site as currently running (successfully) in production, which means my vagrant PHP is 5.6.38 (the actual production PHP is 5.6.25). Running with php-fpm.
Cake's own logs are only reporting the following, which arises inside a controller method function disableCache(), which is trying to insert headers to prevent the browser from caching the request:
2018-10-22 15:18:57 Warning: Warning (2): Cannot modify header information - headers already sent by (output started at /usr/share/nginx/html/www.mydomain.com/cake/libs/object.php:63) in [CORE/cake/libs/controller/controller.php, line 844]
I have inserted an early return in that method just to stop these warnings.
In PHP, I've got these settings:
error_reporting(E_ALL^E_DEPRECATED);
ini_set('display_errors', 1);
ini_set('error_log', '/var/log/php_errors.log');
In Cake 1.2's app/config/core.php, I've got:
Configure::write('debug', 3);
Database is local MySQL in vagrant, with settings in app/config/database.yml.
Can someone suggest where I should go next in debugging this?
From my own experience, PHP 7.1 and CakePHP 1.2 can work together. You simply need to upgrade your source code to make it compatible with PHP 7.1 but you can continue to have your system in CakePHP 1.2 without having to upgrade CakePHP. Of course, if you can use a newer or the latest version of CakePHP that would be perfect but think of it as a separate project and not something you must do now only because your host is upgrading PHP to 7.1 across the board.
If you can get your Cake project upgraded to 1.3.21 (the last 1.x release), you may be able to use this: https://github.com/littleant/cakephp-1.3.21 instead of upgrading to Cake 2.x. Might buy you a little time!
I was using PHP 7.0.4 and everything was running smoothly and I just upgraded to PHP 7.0.8 and I started getting errors like this one all over the place.
Fatal error: Cannot declare class Plugins\Users\Plugin because the name is already in use in /var/www/html/plugins/Users/Plugin.php on line 8
Does anyone have any idea whats going on, I've been reading through the change logs but that's a patch update it should not break anything?
Additionally, if no solution is found to this problem, how can I downgrade back to 7.0.4? (I'm using ubuntu 16.04 and I just upgraded to the point release)
To sum the comments so far:
I have tried disabling opcache this did not solve the problem
I am using composer's autoloader - I am not using require or include anywhere
This error is happening for a ton of classes, so it is clearly not a code issue (on my part), furthermore the code was working before I upgraded to 7.0.8
There is not enough data to say definitively, however I suspect opcache. That error, in fact, originates in opcache so I suspect until this point the error had been hidden by one of several opcode bugs, probably #66773.
You legitimately have an autoloading issue that needs to be fixed. Rename the class, check your namespaces, and remove any hard requires.
You might be able to restore the former buggy behavior by disabling/re-enabling opcache or reverting to 7.0.4, but really the bug was only masked by a particular combination of autoloading and opcache. It was, indeed, only by chance that the issue went undetected until now and it'll be only by chance that you can mask it again.
So the best course is to fix the issue.
Well, apparently I was so blinded by the fact that the error started occurring after the upgrade, that I ignored it even though it was right before my eyes.
These are the first few lines of the class in question (and apparently a bunch of other classes):
<?php
namespace Plugins\Users;
use FW\Utility\Models\Plugins\Plugin;
class Plugin extends Plugin {
As you, and finally I, can clearly see, the class name Plugin is ambiguous, but wasn't in 7.0.4, which is weird and is probably caused by the bug described in bishop's answer
Guess I should have listened to Machavity, huh.
I am running a PHP site that uses Ajax and jQuery as well. The site will run fine for quite some time, and suddently my pages (and ajax-retrieved sub-pages) comes back with the message
PHP has encountered an Access Violation at 77FCAFF8
It seems that rebooting the server corrects the issue. Running PHP Version 5.1.6 (Windows NT 5.0 build 2195). I did a some searching on here and some other sites, and there seems to be no fix..
URL REMOVED
UPDATE:
I think I'm on to something.. will get back to you.
UPDATE
After reviewing the IIS setup, i noticed there was no Handler Mapping setup for the website. This, of course begs the question - how did it ever work in the first place, when it was originally setup this way!? I added the handler mapping and it seems to be Okay so far.
UPDATE
The problem popped its heads out again this morning after 36 hours without encounering it. Back to the drawing board.
UPDATE
We ended up just moving the site to a secondary web server where we were able to upgrade PHP without an issue.
This is a PHP issue somewhere. You could spend some time narrowing down which function you're using that is causing the problem. I would instead upgrade to a newer version of PHP. If still no luck, try a slightly older version. There have been significant changes with version 5.3.2.
After some research I think this may be the solution (Taken from http://bugs.php.net/bug.php?id=28929 ):
[2010-06-11 15:12 UTC] in2ishun at yahoo dot com
***************** SOLUTION!!!!
I realize this issue is AGES old, but it still manages to be the top hit on Google searches as of now (6/2010).
I fixed my own instance of seeing this error. W2k3, IIS6, PHP 5.2.6, MySQL 5.1.
The problem is in the pathing. When I used the MSI installer for MySQL without doing an "advanced" installation (where I could manage the install details), it added a path to the system environment that contained spaces. Even after changing the path environment to use the Windows short-name location of the mysql bin directory, it still didn't work.
The solution was for me to reinstall mysql and set the default installation path to just off the root (e.g. C:\mysql). Once I did that the error went away and my app started working.
There are a number of sites with a variety of potential solutions to this issue and several of them mentioned paths and the "libmysql.dll" file (in the "bin" directory of your mysql installation).
If this helps you solve your problem, consider leaving a comment here so others can see that it works.