Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I've installed GEOS following these steps:
[root@15900696 ~]# cd /usr/share
[root@15900696 share]# wget http://download.osgeo.org/geos/geos-3.3.2.tar.bz2
[root@15900696 share]# tar -xvjf geos-3.3.2.tar.bz2
[root@15900696 share]# cd geos-3.3.2
[root@15900696 geos-3.3.2]# ./configure && make clean && make
[root@15900696 geos-3.3.2]# make install
[root@15900696 geos-3.3.2]# ldconfig
[root@15900696 geos-3.3.2]# vi /etc/ld.so.conf
Added the line:
/usr/local/lib
Saved (ESC -> :x)
Run ldconfig
[root@15900696 geos-3.3.2]# /sbin/ldconfig
Then I've checked it's properly installed:
[root@s15900696 ~]# geos-config --version
3.3.2
Then I've installed GeoPHP 7.x-1.4. In the status report I get the message:
GeoPHP library installed and OK. However, GEOS is was not found. While not required, you will see performance improvements if you install the GEOS PHP extension. See the following link for more information.https://github.com/phayes/geoPHP/wiki/GEOS
It seems that GeoPHP doesn't find the location of GEOS.
Any idea about how to solve this problem?
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#35 | fixphp8.0_deb.patch | 21.86 KB | denix |
Comments
Comment #1
netbek CreditAttribution: netbek commentedI've had success with these instructions http://wygoda.net/blog/testing-geos-33-php-bindings I think you're missing
./configure --enable-php
, and see the note at the end about /etc/php5/conf.d/geos.ini.Comment #2
ecalcerrada CreditAttribution: ecalcerrada commentedThanks you very much, Hein. The problem was php bindings, in effect.
I'm working on Centos 6, so I've followed a slightly different approach than the blog you mentioned:
It works perfectly.
Thanks again.
Comment #3
netbek CreditAttribution: netbek commentedGreat!
Comment #4
phayes CreditAttribution: phayes commentedThanks for the exta info. I'm going to add these instructions to the geoPHP wiki page.
Comment #6
dzieyzone CreditAttribution: dzieyzone commentedHi, I was able to install it in my CentOS 5.8 however when I followed the same instruction to another server running CentOS 6.3, it can't locate the /usr/local/lib folder and what is weird is that when I check the ldconfig the folder seems to be there.
I'm using PHP-fpm by the way.
Comment #7
deanflory CreditAttribution: deanflory commentedI tried numerous times with all the linked instructions that would work on my CentOS 5 server and none would work, kept getting the GEOS not installed on the reports page after a manual cron run.
This mix DID work for me, maybe it will help others but since I have no idea if certain things were not required for my installation or not, they may not all apply but in the end it did finally work (after 3-4 different methods at least 3 times each):
yum install gcc gcc-c++
svn checkout http://svn.osgeo.org/geos/trunk geos-svn
cd geos-svn
./autogen.sh
./configure
./configure --enable-php && make clean && make
make check
make install
ldconfig
vi /etc/ld.so.conf
Add the line:
/usr/local/lib
Save (ESC -> :x) OR simply press Escape then press ZZ to exit and save
As I found vi to be a cryptic and non-user friendly interface where you can't tell if you've actually done anything, I also checked the file with pico to make sure it was actually modified, which it was:
pico /etc/ld.so.conf
Run ldconfig:
ldconfig
/sbin/ldconfig
Next, create a /etc/php5/conf.d/geos.ini file with the following content. I did have a /etc folder but did not have a php5 or therefore conf.d folder so I created those with:
cd /etc
mkdir php5
cd php5
mkdir conf.d
cd conf.d
pico /etc/php5/conf.d/geos.ini
Copy & paste this into the geos.ini file:
Exit (control + x) and Save (control + something I can't remember now, maybe o "oh")
Gracefully restarted my server.
Restarted Apache for good measure.
Check it's properly installed:
geos-config --version
Result was "3.3.2", which is what I was able to get before Drupal/server would properly register it, so ultimately this told me I was doing something right but wasn't the end-all "done" notification.
Bam. Now when I run cron manually (in maintenance mode) and end up on the Status Report page I no longer get the GEOS missing error entry, but instead the lovely new additional next step of:
The link to the github tar.gz appears to still be v1.0, but uploading the geoPHP folder within the geophp module folder to the libraries folder removed the not-using-v1.1 notice on the Status Reports page...
...BUTTTTTTTT after doing so, I get the old GEOS is not installed error/notice. So something isn't right here, going back to installing the old geoPHP library though I'm not sure if that really means GEOS is actually installed and working. This is not fun or productive.
I again deleted the geosPHP library from the libraries folder and reuploaded the version/folder that was within the module folder, which once done continued to show the GEOS not installed on the Status Report page. meh
So, following the zillion breadcrumbs............got me really nowhere. For server techs this might be easy but for a designer like myself I find there are often, what I think are intentional, gaps in instructions for installing things on servers, though I do understand how different distributions and builds can vary. On with actual forward progress and to hell with GEOS since it's clear there is some other mystery configuration I'm just supposed to "know" how to do. Not worth 3 different sessions with really no noticeable result. (sorry, a bit annoyed again at not being able to put this behind me again, again)
Thanks for everyone's help!
Comment #8
liquidcms CreditAttribution: liquidcms commentedi have Cento6 and ran through #2.
geos-config --version gives me 3.3.2
but status report still states: GEOS not found.
Comment #9
phayes CreditAttribution: phayes commentedliquidcms,
Do you have the GEOS php extension enabled in php.ini ?
Comment #10
liquidcms CreditAttribution: liquidcms commentedlikely not; just did what it said in #2
Comment #11
John Pitcairn CreditAttribution: John Pitcairn commentedAnyone gotten this to work on Ubuntu 12, installing the libgeos-3.2.2 package via apt-get?
Comment #12
scottalan CreditAttribution: scottalan commentedFor anyone still trying to install the GEOS PHP extension on Ubuntu 12.04.
I already had the necessary packages installed on my server but you may need run:
sudo apt-get install build-essential
if you run into any errors during the compile process.These are the steps I took:
In my $HOME folder -
// Clone from github.
// Check out the branch you want. I chose to use 3.3.
git checkout origin/svn-3.3 && git checkout -b 3.3
// Next
// Using this instead of just calling `make install`. `sudo apt-get install checkinstall`.
// You can just use `make install` if you want. Read about it here: http://checkinstall.izto.org/
sudo checkinstall
// May want to actually add a version when it asks you.When it's finished there's just one more thing to do:
In
/etc/php5/conf.d
Add a file:geos.ini
This file should contain:extension=/usr/lib/php5/20090626+lfs/geos.so
This should be the correct location for thegeos.so
file but if it's not then just adjust the path accordingly.That's it! Refresh the
admin/reports/status
page and you should see it's installed.Note: You can remove the geos folder that git created from your $HOME folder.
Comment #13
bluecobalt CreditAttribution: bluecobalt commentedOn Centos 6, I did everything in #2 and found that the geos.ini file did not work.
I copied the contents of the geos.ini file to my /usr/local/lib/php.ini file, restarted my server, and presto it works!
This is what I put at the bottom of my php.ini file:
Comment #14
deanflory CreditAttribution: deanflory commentedbluecobalt, you are my hero! *blink* *blink* ;)
I'm on CentOS 5.8 and adding "extension=geos.so" to the /usr/local/lib/php.ini seemed to do the trick to get it recognized in the Status report after a manual cron run.
Alas!:
Comment #15
pedrospI am definitely not able to install this GEOS extension on Ubuntu 12.04LTS...
So sad that the "apt-get install libgeos-dev" did just not work.
I followed #12 ( with the following sequence):
There is no geos.so file on the expected /usr/lib/php5/20090626/geos.so
Ain't no fun at all.
Comment #16
iaminawe CreditAttribution: iaminawe commentedUsing BOA to install GEOS and can confirm it is working and geos is installed and gives a version number. The geos.so file is is in my /opt/local/etc/php53.ini but I still get no love on the drupal status screen. I am also on Ubuntu 12.04LTS.
Any assistance or patches to test would be great. Thanks
Comment #17
RaulMuroc CreditAttribution: RaulMuroc commentedThe instructions of:
http://wygoda.net/blog/testing-geos-33-php-bindings
Are not accessible. Perhaps the server is down :S
Comment #18
iaminawe CreditAttribution: iaminawe commentedI ran the BOA setup again and GEOS seems to have being detected correctly now within Drupal.
Comment #19
sethviebrock CreditAttribution: sethviebrock commentedI would recommend not installing directly from source. Instead, use the autogen.sh command found in the git or svn versions. I used the svn method because installing from source lead to issues. Then, I noticed that during the
configure --enable-php
command it said "configure: WARNING: php-config not found, php support disabled" (solution to this given below).At the end of
./configure --enable-php
it should look like this:If "PHP bindings" is set to "false", it's because PECL and possibly php5-dev are not installed. See http://www.mkfoster.com/2009/01/04/how-to-install-a-php-pecl-extensionmo...
Once I installed PECL and php5-dev, then everything worked like a charm, and the output to
./configure --enable-php
had "PHP bindings" set to true.Comment #20
pedrospI made it finally work that way:
I followed also those instructions to fill-in options during the checkinstall process.
Then created the /etc/php5/conf.d/geos.ini file with the following content:
and finally restart apache2 to se the correct update status on Drupal.
Comment #21
cristian100#2 worked for me for a VPS Centos
Comment #22
phayes CreditAttribution: phayes commentedI just thought I would mention here that you do not *need* GEOS to run GeoPHP. Everything should run just fine without it. It's only required if you need some of the special functions it provides or want a performance boost.
Comment #23
florisg CreditAttribution: florisg commentedFixed this issue in Ubuntu 14.04, same procedure should apply to all Debian/Ubuntu (BOA)
Note: in latest boa 2.3.8 _PHP_GEOS=YES option in .barracuda.cnf works fine.
Found a nice up to date repo in git:
git clone https://github.com/libgeos/libgeos geos
In order to add the library post install with BOA multi php be sure to edit the Makefile.am and adjust paths accordingly
Then run:
Finally add geos.so to either /opt/php53/etc/php.ini or to another shared ini extension location.
Then reload FPM53
sudo service php53-fpm reload
In the logs php logs a source error appears
This means that the Makefile needs more .c dependencies to work with php build.
NOTE: Do not attempt to install php unit testing from apt, it automatically installs appache2 and breaks your setup.
Comment #24
Reis Quarteu CreditAttribution: Reis Quarteu as a volunteer commentedHi.
I followed all the kind instructions I can find in the comments, but none seem to work for me. :(
I google a little, found the following resources, but none of them seems to work either:
* https://github.com/phayes/geoPHP/wiki/Geos-installation-on-centos6
* http://duntuk.com/how-install-geos-centos
* http://stackoverflow.com/questions/22695685/installing-geophp-with-geos-...
* https://geophp.net/geos.html
I'm using PHP 5.4.38, Zend Engine v2.4.0, ionCube PHP Loader v4.6.1, Zend Guard Loader v3.3, and CentOS 6.6.
Any help will be greatly appreciated.
Many thanks in advance! :)
Comment #25
deanflory CreditAttribution: deanflory as a volunteer commentedThis below worked on CentOS 6.6 on 2015-07-31 with everything updated and resulted in a Drupal 7.38 cron run showing GEOS is installed on the Status Report page:
Via Terminal:
Check it's properly installed:
geos-config --version
The last thing to enable the GEOS extension in PHP is to create a /etc/php5/conf.d/geos.ini file with the following content:
OR using WHM > Service Configuration > PHP Configuration Editor > Advanced Mode > Core > extension > geos.so
Restart your server.
Log back in via SSH and check that it's still installed and recognized:
geos-config --version
Run cron on your Drupal site and you should receive:
Comment #26
Reis Quarteu CreditAttribution: Reis Quarteu as a volunteer commentedHi.
Just want to say that GEOS has been working perfectly since some time after my previous comment. It seems Drupal needs some time to make sure GEOS is correctly installed on the server.
Best regards to all! :)
Comment #27
pedrospUpdating to PHP7 with Ubuntu 16.04 LTS
add to php.ini
extensions=geos.so
service php-fpm restart
Comment #28
Donit CreditAttribution: Donit commentedEditing php.ini didn't worked out for me. I needed to create an additional geos.ini-file. My steps:
Save and exit.
Flush the caches. Check the Status report; GEOS should be installed.
Comment #29
Joel MMCC CreditAttribution: Joel MMCC commentedAre there any good Drupal-optimized hosting services (shared, grid, cloud, or VPS) that have GEOS already installed?
Comment #30
Donit CreditAttribution: Donit commented@Joel It won't be preinstalled on regular shared hosting (at least, I've never seen this). You can ask Drupal-specialized hosts like Acquia, Platform.sh and Pantheon if they have GEOS installed. On cloud and VPS, you have to do it yourself. You can easily do this by following the steps above (you just may want to adjust the used PHP-Version, if you use another one).
Comment #31
WJNLLC CreditAttribution: WJNLLC commentedhttps://github.com/phayes/geoPHP/wiki/cPanel-geos-%22GEOS-PHP%22-geos.so
Comment #32
Joel MMCC CreditAttribution: Joel MMCC commentedAnyone know of a way to install GEOS on an Aqcuia Development Desktop 2 for Windows installation?
Comment #33
frogdog_tech CreditAttribution: frogdog_tech at frogdog commented#27 bingo! cheers.
Comment #34
erwangel CreditAttribution: erwangel commented#28 done it for Debian 9 (stretch)! same as #27 with better detailed steps to php.ini. Thank you pedrosp and Donit!
Just adjust script for your php version if you are not in 7.1; mine was 7.0 (see #30)
Comment #35
denix CreditAttribution: denix as a volunteer commentedIf anyone is interested in php8.0 here is a little patch, thanks to Remi Collet and @Donit
or, if you are using Lando (or Docker), add these lines:
where /app/geos.so is you compiled binary (you can also compile it directly in lando)
Comment #36
steinmb CreditAttribution: steinmb at University Of Bergen commentedConsider this support req. answered.