# 3.x and PHP versions

**URL:** <https://forum.getkirby.com/t/3-x-and-php-versions/23831>\
**Category:** Questions\
**Tags:** v3\
**Created:** [November 1, 2021, 4:50pm UTC](https://forum.getkirby.com/t/3-x-and-php-versions/23831 "2021-11-01T16:50:49Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![tcurdt](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/tcurdt/32/11115_2.png) [@tcurdt](https://forum.getkirby.com/u/tcurdt)\
**Post date:** [November 1, 2021, 4:50pm UTC](https://forum.getkirby.com/t/3-x-and-php-versions/23831/1 "2021-11-01T16:50:49Z")

</div>

I need to upgrade from PHP 7.3.

But it seems like version 3.2.2 has some issues with PHP 7.4 and 8.0.

Should it work with PHP 7.4/8.0?  
Or do I need to upgrade to kirby 3.5?

Any gotchas to be aware?  
The update instructions are very minimalistic.  
Upgrade the kirby folder and delete the media folder.

Thanks!

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 1, 2021, 5:14pm UTC](https://forum.getkirby.com/t/3-x-and-php-versions/23831/2 "2021-11-01T17:14:02Z")

</div>

> [@tcurdt](#):
>
> Should it work with PHP 7.4/8.0

Support for PHP 8.0 was added with Kirby 3.5. PHP 7.4 I’m not quite sure, but I found that testing for 7.4 was added with 3.3.

Since 3.2.2 there have been multiple security updates, so updating is a good idea in general.

But since 3.2.2, there have also been multiple breaking changes (each 3.x.0 version usually has them). So while the general updates procedure is “replace the kirby folder and delete the media folder”, it also means testing if your code is still compatible with the new version and fix breaking changes.

You can find all breaking changes in the release notes.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 1, 2021, 6:13pm UTC](https://forum.getkirby.com/t/3-x-and-php-versions/23831/3 "2021-11-01T18:13:16Z")

</div>

Please don’t double-post on Discord and here, thanks!

---

<div class="post-metadata">

**Author:** ![something-strange](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/something-strange/32/8796_2.png) [@something-strange](https://forum.getkirby.com/u/something-strange)\
**Post date:** [April 6, 2022, 8:38pm UTC](https://forum.getkirby.com/t/3-x-and-php-versions/23831/4 "2022-04-06T20:38:24Z")

</div>

Hi @texnixe,

Sorry to trouble you, things have been running great for over a year. The client has been making updates with the Kirby CMS on a weekly and monthly basis, and all is working great!

But now I need to make a quick CSS change and things are breaking locally…

I’m using the Kirby Vue-Nuxt Startetkit with Kirby (3.x / 3.5 I think?)

When I cd into my /vue-nuxt folder and run `npm run dev` everything looks nice:

![image.png](https://mail.google.com/mail/u/1?ui=2&ik=33e98b3121&attid=0.3&permmsgid=msg-a:r6658719513250477433&th=17ffc833af59a465&view=fimg&fur=ip&sz=s0-l75-ft&attbid=ANGjdJ97p9V_j8cCZ3bnFDb8goc2ALDLp_03cfL3GsHR0-8WgEKxpw0e_Bbp9p-8_3dsqI828dHdgjtyW6jsqPbZcLmwMEG2sQns7ZUF4DkV9ngtSKhAJMLEKDt34zo&disp=emb&realattid=ii_l1mwemxj3)

But when I jump over to [http://localhost:3000/](http://localhost:3000/), I’m getting an error from the Kirby API…

![image.png](https://mail.google.com/mail/u/1?ui=2&ik=33e98b3121&attid=0.2&permmsgid=msg-a:r6658719513250477433&th=17ffc833af59a465&view=fimg&fur=ip&sz=s0-l75-ft&attbid=ANGjdJ-ZrITlSOXrcjXWKzaGhBB8Ay8eaydMVRzk-eTy3WN-wyYt_NeIzog-TyewjzJd1q9vWjCWGLllKr6nHzNdt0_-CXMiePPOh5qwXXsFXBH8WPVE_tuA_1FO6PE&disp=emb&realattid=ii_l1mwbutz2)

And if I go to [http://127.0.0.1:8000/](http://127.0.0.1:8000/) I get this offline message:  
 ![image.png](https://mail.google.com/mail/u/1?ui=2&ik=33e98b3121&attid=0.1&permmsgid=msg-a:r6658719513250477433&th=17ffc833af59a465&view=fimg&fur=ip&sz=s0-l75-ft&attbid=ANGjdJ_zcYl80BxoD-t2R6AHtbVK8y97hYOb4lWeun2YQRSd7BJiybohAsfUSG6YkACUzAaoAOP-yhRRTPeHC0qtOqVNuOsNKIXQygsCZ0VvmJD49WnV_Dmfoj6l-gY&disp=emb&realattid=ii_l1mwad6u1)

So then I changed my php version from 8.1 to 7.4 and I’m getting an ambiguous error getting data from the Kirby API using [http://localhost:3000](http://localhost:3000), so if I jump to [http://127.0.0.1:8000/](http://127.0.0.1:8000/) I get a CORS blocker error:

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/9/9fb34ffadb60b08003dc8c8cfb3dfe8062276e70.png)

It appears it is trying to get data from the live site instead of my local dev environment. I’m confused because I haven’t touched anything in X amount of months and now this just won’t work locally.

Any thoughts? I hope I’m missing something totally obvious, hah. Been a while since I touched this project, thank you for your time as always!

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 6, 2022, 8:45pm UTC](https://forum.getkirby.com/t/3-x-and-php-versions/23831/5 "2022-04-06T20:45:22Z")

</div>

I have absolutely zero experience with a Vue-Nuxt frontend setup. But I’d check if there are either any hardcoded links to assets or if there is any caching going on.

---

<div class="post-metadata">

**Author:** ![helloanselm](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/helloanselm/32/11487_2.png) [@helloanselm](https://forum.getkirby.com/u/helloanselm)\
**Post date:** [April 7, 2022, 8:13am UTC](https://forum.getkirby.com/t/3-x-and-php-versions/23831/6 "2022-04-07T08:13:44Z")

</div>

Do you use [GitHub - jmheretik/kirby-vue-starterkit: Kirby + Vue.js](https://github.com/jmheretik/kirby-vue-starterkit) or a custom setup? In either case, check the configs that specify where your API is fetched from. Somewhere you likely have a setting for fetching the live API.  
Another thing to look at is the Kirby config files, if the hostname doesn’t match there (i.e. `localhost` is not `127.0.0.1`) it will likely fetch another config (default one).

Then, which exact Kirby version is used? I remember that some 3.5.x version had changed with JSON API requests but I think it would actually result in a different error.

Your main issue seems to be that CORS is blocked (correctly) due to the wrong API being called… hard to debug without having more details of your config.

---

<div class="post-metadata">

**Author:** ![something-strange](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/something-strange/32/8796_2.png) [@something-strange](https://forum.getkirby.com/u/something-strange)\
**Post date:** [April 7, 2022, 12:11pm UTC](https://forum.getkirby.com/t/3-x-and-php-versions/23831/7 "2022-04-07T12:11:19Z")

</div>

No worries, thanks @texnixe!

---

<div class="post-metadata">

**Author:** ![something-strange](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/something-strange/32/8796_2.png) [@something-strange](https://forum.getkirby.com/u/something-strange)\
**Post date:** [April 7, 2022, 12:36pm UTC](https://forum.getkirby.com/t/3-x-and-php-versions/23831/8 "2022-04-07T12:36:30Z")

</div>

@helloanselm,

Thanks for the reply! You are correct, I am using this [Kirby +Vue.js Starterkit](https://github.com/jmheretik/kirby-vue-starterkit).

In my **`/vue-nuxt`** folder, I have these environment files:

**.env**

```auto
NUXT_ENV_BASE_URL=/
NUXT_ENV_KIRBY_URL=http://127.0.0.1:8000

```

**`.env.production`**

```auto
NUXT_ENV_BASE_URL=/
NUXT_ENV_KIRBY_URL=https://hovercraftstudio.com

```

In the root folder, here is my **`kirby.config.js`** file:

```auto
module.exports = {
  serve: true,
  host: '127.0.0.1',
  port: 8000,
  inject: true,
  base: __dirname + '/kirby',
  assetsDir: 'vue-assets',
  indexPath: 'site/plugins/kirby-vue-starterkit/vue-index.php',

  start: php => {
    php.createServer({
      hostname: module.exports.host,
      port: module.exports.port,
      base: module.exports.base,
      router: 'kirby/router.php'
    })

    console.log(`i Kirby running at: http://${module.exports.host}:${module.exports.port}`)
  },

  stop: php => php.close(),

  clean: fs => {
    fs.removeSync(module.exports.base + '/' + module.exports.assetsDir)
    fs.removeSync(module.exports.base + '/' + module.exports.indexPath)
  }
}

```

I’m not sure how to tell which version of Kirby I am running. I know it is 3.x something, hah.

Also, worth noting, when I run `php -v` in my terminal, I am using `PHP 7.3.11`

I have tried using a MAMP trial and installing PHP@8.1 with Homebrew but nothing worked, so I am back on 7.3.11 and not using MAMP.

If there are any other files you think I should upload to make debugging easier, just let me know. The GitHub repo for this project has changed a bit in the past 1-2 years since I first started with it so it is not using the exact 1:1 files, mainly the `nuxt.config` and `plugins/kirby-api.js` files don’t appear to exist in the latest repo.

Biggest note here, I haven’t modified anything over the past year in any of the api or config files, so this must be some automated / version update under the hood that I don’t know about.

Thank you all for your time, much appreciated!

---

<div class="post-metadata">

**Author:** ![helloanselm](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/helloanselm/32/11487_2.png) [@helloanselm](https://forum.getkirby.com/u/helloanselm)\
**Post date:** [April 7, 2022, 1:25pm UTC](https://forum.getkirby.com/t/3-x-and-php-versions/23831/9 "2022-04-07T13:25:08Z")

</div>

So it seems that your production env variables are being used now for local development. Still tricky to guess what the problem is. Do you have one `site/config/config.php` or multiple for Kirby?

You can always see the kirby version in the panel (top bar menu \> system) or in `composer.json` in the kirby folder.

---

<div class="post-metadata">

**Author:** ![something-strange](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/something-strange/32/8796_2.png) [@something-strange](https://forum.getkirby.com/u/something-strange)\
**Post date:** [April 8, 2022, 9:08pm UTC](https://forum.getkirby.com/t/3-x-and-php-versions/23831/10 "2022-04-08T21:08:52Z")

</div>

Hi @helloanselm,

Thanks again for the reply, I got sidetracked hah, but here’s what I have:

- Kirby 3.4
- Php 7.3.11
- Just the one `config.php` file. Here’s what that looks like:

```auto
return [
  'debug' => false,
  'panel' => [
    'install' => true,
    'css' => 'assets/css/custom-panel.css'
  ],
  'api' => [
    'allowInsecure' => false,
    'basicAuth' => true
  ],
  'kirby-vue-starterkit.plugin.useVueIndex' => true,
  'medienbaecker.autoresize.maxWidth' => 3000
];

```

I also noticed in my **`/kirby/.htaccess`** file, I had to add these 2 lines at some point.

```auto
RewriteCond %{HTTP_HOST} ^www.hovercraftstudio.com$ [NC]
RewriteRule ^(.*)$ https://hovercraftstudio.com/$1 [R=301,L]

```

Taking these out and restarting my server with `npm run dev` still didn’t change anything though.

As always, thank you for your time and help! Enjoy your weekend, we can pick things up next week, no urgency. 🕶

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 8, 2022, 9:48pm UTC](https://forum.getkirby.com/t/3-x-and-php-versions/23831/11 "2022-04-08T21:48:00Z")

</div>

Kirby 3.4 supports PHP 7.2-7.4, this just on a side note.

Also, when you are using the API locally without SSL, you will have to set `allowInsecure` to true.

But this is not related to the error message you are getting.

---

<div class="post-metadata">

**Author:** ![something-strange](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/something-strange/32/8796_2.png) [@something-strange](https://forum.getkirby.com/u/something-strange)\
**Post date:** [April 14, 2022, 2:47pm UTC](https://forum.getkirby.com/t/3-x-and-php-versions/23831/12 "2022-04-14T14:47:04Z")

</div>

Thanks @texnixe,

I set `'allowInsecure' => true` but still no luck.

–

I uninstalled and remove Homebrew (in case that installed php and was trying to run another php version, idk). So I still have php@7.3.11 on my Mac OS… and confirmed I’m running Kirby 3.4.

Would it help if I upload a few files (my nuxt.config, .env, .env.production etc)? Again, I never edited this but the Git repo now has a much different nuxt.config, and there are no Kirby api plugin files in whatever they updated in the repo.

Typing out loud. I’m just running out of ideas, hah.

Thanks everyone!
