Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class 'Transliterator' not found #1082

Closed
Rajavelu opened this issue Jul 4, 2018 · 4 comments
Closed

Class 'Transliterator' not found #1082

Rajavelu opened this issue Jul 4, 2018 · 4 comments

Comments

@Rajavelu
Copy link

Rajavelu commented Jul 4, 2018

Hi,
Got error as Class 'Transliterator' not found while calling geocode in my own setup of Nominatim-3.1.0 in centos7. I am using nginx server and installed php-intl too. (#747).

Note:
Tried as separate test PHP code for Transliterator(as follows) and its working. But in Geocode.php met Class 'Transliterator' not found.

$str = 'àáâãäçèéêëìíîïñòóôõöùúûüýÿ
ÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ';
$rule = 'NFD; [:Nonspacing Mark:] Remove; NFC';

$myTrans = Transliterator::create($rule);
echo $myTrans->transliterate($str);

EDIT: If i called above test PHP in a browser or curl, met the same error. But working fine in terminal

Thanks in advance for any help.

@mtmail
Copy link
Collaborator

mtmail commented Jul 4, 2018

I tested our CentOS7 Vagrant setup (https://github.com/openstreetmap/Nominatim/tree/master/vagrant), disabled Apache and setup nginx, imported one country (Monaco) but don't see the same error.

$ rpm --query centos-release
centos-release-7-5.1804.el7.centos.2.x86_64

[vagrant@localhost build]$ curl 'http://localhost/search.php?q=Monaco&format=json&pretty=1'
[
    {
        "place_id": "100195",
        "licence": "Data © OpenStreetMap contributors, ODbL 1.0. https:\/\/osm.org\/copyright",
        "osm_type": "node",
        "osm_id": "1790048269",
        "boundingbox": [
            "43.5711424",
            "43.8911424",
            "7.2597576",
            "7.5797576"
        ],
        "lat": "43.7311424",
        "lon": "7.4197576",
        "display_name": "Monaco, 98020, Monaco",
        "class": "place",
        "type": "city",
        "importance": 0.20375,
        "icon": "\/nominatim\/images\/mapicons\/poi_place_city.p.20.png"
    }
]

So that rules out SELinux permission issues or missing packages at least.

Did you have to install php-intl? Does restarting the services help?

sudo systemctl restart nginx
sudo systemctl restart php-fpm

Any error messages in /var/log/php-fpm/?

Does searching via the command-line work?

[vagrant@localhost build]$ utils/query.php --search Monaco
[
    {
        "osm_type": "N",
        "osm_id": "1790048269",
        "class": "place",
        "type": "city",
        ....

@Rajavelu
Copy link
Author

Rajavelu commented Jul 5, 2018

@mtmail Thanks for your response, and which version of php & php-fpm you are using?
If I called above test PHP(with Transliterator) in a browser or in curl, met the same error. But working fine when running in the terminal(php test.php)

Using php-7.2.6 and php5-fpm together. That may be the issue

@mtmail
Copy link
Collaborator

mtmail commented Jul 5, 2018

which version of php & php-fpm you are using?

The default for CentOS when fresh installed. That's PHP 5.4.

Is it possible you have two different versions of PHP installed on your system?

Try running php -r 'echo phpversion();' on command line. And add var_dump(phpversion()); inside Geocode.php to figure out which PHP version is running in the php5-fpm environment (the output might go into the webserver error log).

@lonvia
Copy link
Member

lonvia commented Jul 6, 2018

The discussion in this ticket has drifted into matters of generic system and database administration and as such out of scope for this issue tracker. Please use google and generic help sites like stackoverflow to resolve the issue. Closing here.

@lonvia lonvia closed this as completed Jul 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants