# Php occ db:add-missing-indices

**URL:** <https://help.nextcloud.com/t/php-occ-db-add-missing-indices/90967>\
**Category:** ℹ️ Support\
**Created:** [August 30, 2020, 1:46pm UTC](https://help.nextcloud.com/t/php-occ-db-add-missing-indices/90967 "2020-08-30T13:46:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![elChupete](https://help.nextcloud.com/letter_avatar/elchupete/32/6_22734026db12803ebb3e059622ac3534.png) [@elChupete](https://help.nextcloud.com/u/elChupete)\
**Post date:** [August 30, 2020, 1:46pm UTC](https://help.nextcloud.com/t/php-occ-db-add-missing-indices/90967/1 "2020-08-30T13:46:38Z")

</div>

Hi,

when I execute php occ db:add-missing-indices to add missing indices I get  
following error

PHP Parse error: syntax error, unexpected ‘class’ (T\_CLASS), expecting identifier (T\_STRING) or variable (T\_VARIABLE) or ‘{’ or ‘$’ in /var/www/vhosts//console.php on line 97

I am running on php 7.3 and nextcloud **19.0.2**

any help?

---

<div class="post-metadata">

**Author:** ![LordSimal](https://help.nextcloud.com/user_avatar/help.nextcloud.com/lordsimal/32/61932_2.png) [@LordSimal](https://help.nextcloud.com/u/LordSimal)\
**Post date:** [August 30, 2020, 8:31pm UTC](https://help.nextcloud.com/t/php-occ-db-add-missing-indices/90967/2 "2020-08-30T20:31:47Z")

</div>

This seems to me, that your CLI PHP-Version is a very old one (something 5.4 or so)  
Check your CLI PHP version with `php -v`

The CLI PHP-Version doesn’t need to be the same as on what the Nextcloud aka Webserver is running with.

If you found the corret PHP-Binary with at least PHP 7.3 you can execute the occ command like that

`php73 ./occ db:add-missing-indices`

This requires, that you are currently in the nextclouds “root” directory where the occ command is located.

---

<div class="post-metadata">

**Author:** ![elChupete](https://help.nextcloud.com/letter_avatar/elchupete/32/6_22734026db12803ebb3e059622ac3534.png) [@elChupete](https://help.nextcloud.com/u/elChupete)\
**Post date:** [September 2, 2020, 6:49pm UTC](https://help.nextcloud.com/t/php-occ-db-add-missing-indices/90967/3 "2020-09-02T18:49:37Z")

</div>

Thanks worked like a charm

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 12, 2024, 8:15am UTC](https://help.nextcloud.com/t/php-occ-db-add-missing-indices/90967/4 "2024-12-12T08:15:30Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 12, 2024, 8:15am UTC](https://help.nextcloud.com/t/php-occ-db-add-missing-indices/90967/5 "2024-12-12T08:15:31Z")

</div>


