libcurl - easy.h configuration prob - ubuntu-10.10

my php installation has got some problem while installing I am getting
following error:
configure: error: Please reinstall the libcurl distribution -
easy.h should be in /include/curl/
which version of the libcurl should i use for php-5.2.8 installation
thanks in advance

Try With This
None of these will allow you to compile PHP with cURL enabled.
In order to compile with cURL, you need libcurl header files (.h files). They are usually found in /usr/include/curl. They generally are bundled in a separate development package.
Per example, to install libcurl in Ubuntu:
sudo apt-get install libcurl4-dev
Then you can just do:
./configure --with-curl # other options...
If you compile cURL manually, you can specify the path to the files without the lib or include suffix. (e.g.: /usr/local if cURL headers are in /usr/local/include/curl).

Hopefully this will help, I had to do some PHP work on one project and the following are the steps I have done and documented for future, hopefully it will be some use to you or some other people.
Setup PHP, MySql on Ubuntu 12.4
1- Install Apache2:
sudo apt-get install apache2
- Open up any web browser and then enter http://localhost/
You should see a folder entitled apache2-default/. Open it and you will see a message saying "It works!" , congrats to you!
2-Install PHP:
sudo apt-get install php5 libapache2-mod-php5
Restart apache2
sudo /etc/init.d/apache2 restart
3- Test PHP
sudo gedit /var/www/testphp.php
This will open up a file called phptest.php.
Copy/Paste this line into the phptest file:
Save and close the file, open you're web browser and type the following into the web address: http://localhost/testphp.php
-you should see a long file opened
4- Install MySQL
sudo apt-get install mysql-server
-In order for other computers on your network to view the server you have created, you must first edit the "Bind Address". Begin by opening up Terminal to edit the my.cnffile.
gksudo gedit /etc/mysql/my.cnf
-Change the line
bind-address = 127.0.0.1
And change the 127.0.0.1 to your IP address.
-This is where things may start to get tricky. Begin by typing the following into Terminal:
mysql -u root
-Following that copy/paste this line:
mysql> SET PASSWORD FOR 'root'#'localhost' = PASSWORD('yourpassword');
-(Make sure to change yourpassword to a password of your choice.)
- install a program called phpMyAdmin which is an easy tool to edit your databases.
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
-After that is installed our next task is to get PHP to work with MySQL. To do this we will need to open a file entitled php.ini. To open it type the following:
gksudo gedit /etc/php5/apache2/php.ini
Now we are going to have to uncomment the following line by taking out the semicolon (;).
Change this line:
;extension=mysql.so
To look like this:
extension=mysql.so
Now just restart Apache and you are all set!
sudo /etc/init.d/apache2 restart

Related

After install of php5-mysqlnd: MySQL server has gone away + crazy amount of connections

OS: Ubuntu 14.04
PHP Version 5.5.9-1ubuntu4.23
MySQL '5.6.33-0ubuntu0.14.04.1'
After installing php5-mysqlnd, the SQL server doesn't maintain a connection with apache2.
Installed using the following steps
sudo apt-get remove php5-mysql
sudo apt-get install php5-mysqlnd
sudo service apache2 restart
In phpinfo() I get the following information under mysqlnd
active_connections 18446744073709551613
active_persistent_connections 18446744073709551613
All other information from that table is zero, except for bytes_received which is 95
Under mysqli, i get the following
Client API library version mysqlnd 5.0.11-dev
mysqli.allow_persistent On On
Basically it seems the connection is timing out, but the number of connections is weird in phpinfo();
I also tried adding extension=mysqlnd.so to php.ini as per this post:
install both mysql and mysqlnd on ubuntu 12.04
First You Remove The Program(ie Apache,Sql,And Php And Its Modules) and Then Start Again To Install, Because Some It Occurs.
Do It.

Got error while installing module in magento2 'SQLSTATE [HY000] [2000] No such file or directory'

I Created module in magento 2.
Trying to install created module by use of command - ' sudo php bin/magento setup:upgrade ' and i got following error.
I found a way to resolve this issue is:
get error: SQLSTATE[HY000] [2002] No such file or directory
solution: create symlink from mamp mysql.sock to /tmp/mysql.sock
ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock
The cause of my case is Mamp install mysql and socket in other directory and Magento 2 looking mysql.sock in default place. So we just need to link the default place to Mamp place. This will resolve this issue.
I think this error happens when your command line php does not communicate with the database.
Check which php are you using in command line by typing which php. Is it the same one used by your server? If not make sure you export it in your bash profile. For example the mamp php on mac:
export PATH=/Applications/MAMP/bin/php/php7.0.0/bin:$PATH
Also check that the command line is using the right mysql where your database is stored. If you login into mysql via terminal:
1) does the db exist there?
2) does the user have enough privileges?
Also you can append the command with -v, --v, or ---v to see more detailed messages.
Just update your right IP address and host name to the host configuration file
I am using fedora 23 my configuration file located in /etc/hosts
command for edit configuration
$ sudo gedit /etc/hosts
then add the below line or edit your old configuration
<ip-address> <host name>
for example 192.168.1.8 bu.gworks.mobi
Go to /app/etc/env.php and change:
'host' => 'localhost',
to:
'host' => '127.0.0.1',

Tilemill error Could not create datasource for type: 'postgis' (searched for datasource plugins in '/usr/lib/mapnik/input')

Followed link OSM Quick start
Had little bilt problems but i managed to perform all the steps. But when my opened my newly created project in tilemill we just mad it shows error
Could not create datasource for type: 'postgis' (searched for datasource plugins in '/usr/lib/mapnik/input') encountered during parsing of layer 'landuse_gen0' in Layer at line 197
Can somebody tell me what this error and how to resolve it. I have followed all steps n provide link above?
The "OSM Bright Quick Start" page is a bit outdated. A few differences to handle installing postgres/postgis for Linux Mint 17.1/Ubuntu 14.04 to handle in Step 0 + 1:
sudo apt-get install postgresql-9.3-postgis-2.1
sudo apt-get install mapnik-input-plugin-postgis
# Set every method to "trust"
sudo vim /etc/postgresql/9.3/main/pg_hba.conf
sudo /etc/init.d/postgresql restart
psql -U postgres -c "create database osm;"
psql -U postgres -d osm -f /usr/share/postgresql/9.3/contrib/postgis-2.1/postgis.sql
psql -U postgres -d osm -f /usr/share/postgresql/9.3/contrib/postgis-2.1/spatial_ref_sys.sql
This worked for me. Then follow with Step 2...
You should check the directory /usr/local/lib/mapnik/input, and you will find the file postgis.input is missing.
The reason is that when you compile mapnik, the dependency for plugin 'postgis' can not be satisfied. You can run python scons/scons.py INPUT_PLUGINS='postgis' in the shell and you would be reminded some dependency problem. So you should add the postgresql and postgis to the system environment before make mapnik.
Make sure postgresql94-devel has been already installed or you can run sudo yum install postgresql94-devel.Then, you can do like this
export PATH=$PATH:/usr/pgsql-9.4/bin:/usr/pgsql-9.4/lib:/usr/local/lib
and then use the ./configure,make and make install command for mapnik. After reinstallation of mapnik, you should find postgis.input in the directory /usr/local/lib/mapnik/input and then try again.

Omniauth Facebook Error - Faraday::Error::ConnectionFailed

(FYI: I'm following the Twitter Omniauth from railscast #241. I used Twitter successfully, now going onto Facebook)
As soon as I logged into Facebook using Omniauth, I get this error:
Faraday::Error::ConnectionFailed
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
What does this mean?
This is my code
Rails.application.config.middleware.use OmniAuth::Builder do
provider :facebook, '<key from fb>', '<another key from fb>'
end
There's actually nothing much in my code, all I have is in the sessionController that I want to use to_yaml to see what's inside the request.env
class SessionsController < ApplicationController
def create
raise request.env["omniauth.auth"].to_yaml
end
end
How do I solve the Faraday error?
I've fixed this on Mac OS X Lion 10.7.4 with this solution:
$ rvm remove 1.9.3 (or whatever version of ruby you are using)
$ rvm pkg install openssl
$ rvm install 1.9.3 --with-openssl-dir=$rvm_path/usr
after this you will need to download the missing cacert.pem file:
$ cd $rvm_path/usr/ssl
$ sudo curl -O http://curl.haxx.se/ca/cacert.pem
$ sudo mv cacert.pem cert.pem
You are getting this error because Ruby cannot find a root certificate to trust.
Fix for Windows: https://gist.github.com/867550
Fix for Apple/Linux: http://martinottenwaelter.fr/2010/12/ruby19-and-the-ssl-error/ <--This site is now down.
Here is the Apple/Linux fix according the site above:
The solution is to install the curl-ca-bundle port which contains the same root certificates used by Firefox:
sudo port install curl-ca-bundle
and tell your https object to use it:
https.ca_file = '/opt/local/share/curl/curl-ca-bundle.crt'
Note that if you want your code to run on Ubuntu, you need to set the ca_path attribute instead, with the default certificates location /etc/ssl/certs.
In the end, that’s what will work on both Mac OS X and Ubuntu:
require 'net/https'
https = Net::HTTP.new('encrypted.google.com', 443)
https.use_ssl = true
https.verify_mode = OpenSSL::SSL::VERIFY_PEER
https.ca_path = '/etc/ssl/certs' if File.exists?('/etc/ssl/certs') # Ubuntu
https.ca_file = '/opt/local/share/curl/curl-ca-bundle.crt' if File.exists('/opt/local/share/curl/curl-ca-bundle.crt') # Mac OS X
https.request_get('/')
Andrei's answer didn't work for me on Mac OSX 10.8.3. I had reinstalled openssl to install ruby 2.0 some time ago and since then always got this error. I fixed it thanks to Andrei's answer and instructions from the Rails project.
I ran:
$ rvm -v
$ rvm get head
# Installation of latest version of rvm...
$ rvm -v
# rvm 1.19.5 (master)
$ rvm osx-ssl-certs status all
# Certificates for /usr/local/etc/openssl/cert.pem: Old.
# Certificates for /Users/mpapis/.sm/pkg/versions/openssl/0.9.8x/ssl/cert.pem: Old.
$ sudo rvm osx-ssl-certs update all
# Updating certificates...
Then I checked if the certificates were correctly updated by running rvm osx-ssl-certs status all again but /usr/local/etc/openssl/cert.pem was still not updated. I don't know if that was necessary but I did the following:
$ cd /usr/local/etc/openssl/
$ curl -O http://curl.haxx.se/ca/cacert.pem
$ mv cacert.pem cert.pem
After that the problem was fixed. Hope that helps someone else who runs into the same issue.
this worked for me (on Mac OS X):
$ brew install curl-ca-bundle
$ export SSL_CERT_FILE=/usr/local/opt/curl-ca-bundle/share/ca-bundle.crt
Alternative Solution:
[I am Win7 user with manual install the Ruby and Ruby on Rails]
I have the same problem but cannot resolve by the answer that given by this question. By the way, finally, I got problem solved by following url
Facebook Redirect url in ruby on rails open ssl error
https://github.com/technoweenie/faraday/wiki/Setting-up-SSL-certificates
The RVM website suggests running rvm osx-ssl-certs update all
RVM Website: How to fix broken certificates in your operating system.
For Windows 7: the above solution link of Neil Hoff (Fix for Windows: https://gist.github.com/867550) did not work for me.
Here is what works:
Using cmd.exe:
curl -o c:\cacert.pem http://curl.haxx.se/ca/cacert.pem
set SSL_CERT_FILE=c:\cacert.pem
using msysgit bash:
curl -o /c/cacert.pem http://curl.haxx.se/ca/cacert.pem
export SSL_CERT_FILE=/c/cacert.pem
If you do not have curl on your windows 7 command line get it here:
http://www.confusedbycode.com/curl/#downloads
original solution is from here - credit to:
https://github.com/chef/chef-dk/issues/106
Dunn.
Andrei's answer worked for me, however I ran into a huge roadblock when trying to reinstall Ruby 1.9.3. Because I had installed a new version of Xcode since installing 1.9.3 I was unable to reinstall until I opened the Xcode Preferences and installed the Command Line Tools from the Downloads tab.
Check out certified gem. Description:
Ensure net/https uses OpenSSL::SSL::VERIFY_PEER to verify SSL
certificates and provides certificate bundle in case OpenSSL cannot
find one

Trying to install LAMP on Centos?

Hey guys I'm running Centos 6.2 minimal, and I am trying to install LAMP for my server and following this tutorial.
It installed flawlessly however when I try to configure the services to start automatically, its cool with
/sbin/chkconfig httpd on
but when I try
/sbin/chkconfig --add mysqld
it says:
error reading information on service mysqld: No such file or directory
is mysqld installed? try yum install mysql-server or some such. it might also not be named mysqld but mysql see /etc/init.d/ directory for the scripts.
System cannot find mysqld in /etc/init.d
Try: locate mysqld
Normally it will be /u/sbin or /u/bin folder (depends on Operating system and default settings).
copy mysqld (if you find it) to /etc/init.d folder, check the file permission.
Then try chkconfig --add mysqld again.
Post your result of the command above if you still cannot get it going.