2

My Local Environment

PHP - 7.2
OS - Windows

My Server Environment

PHP - 7.1
OS - CentOS

I have tinyint(1) mysql column type. When I run my php code at local it returns integer data from database of integer column but when I run the code at my server it returns string value.

I also tried to run yum install php-mysqlnd command at my server but I got Error:

php71w-common conflicts with php-common-5.4.16-45.el7.x86_64

How can I solve this?

I'm using slim-3 framework with eloquent ORM.

NikiC
  • 100,734
  • 37
  • 191
  • 225
Saurabh Sharma
  • 463
  • 2
  • 7
  • 20
  • According to [this answer](https://stackoverflow.com/a/25692758/965834), installing `php-mysqlnd` would be the way to go. So you probably need to ask ServerFault about that error you're getting. Maybe it's the same as [that one](https://serverfault.com/questions/935227/error-php71w-common-conflicts-with-php-common-5-4-16-45-el7-x86-64)? – Jeto Nov 23 '18 at 11:02

1 Answers1

0

The problem could be that you use different versions of Eloquent ORM in your local and server setup. This could be caused by different php version, if you load your dependencies via Composer.

You could try constraining php version in your composer.json, generate composer.lock and then run composer install --ignore-platform-reqs, if your environment is not matching the prerequisite.

Composer.json:

"require": {
    "php": "^7.1",
    ...
},
"config": {
    "platform": {
        "php": ^7.1"
    }
}
Dejv
  • 944
  • 2
  • 14
  • 31