1

So I've tried every solution I can find online and nothing seems to be working. I'm trying to get my first Facebook app off the ground. I'm running Apache 2.4. I installed PHP 5.4.11 manually to C:\php. I updated C:\php\php.ini changing the extension_dir to

extension_dir = "c:\php\ext"

and removing the semicolon in front of

extension=php_curl.dll

I've also added libeay32.dll and ssleay32.dll to C:\Windows, C:\Windows\System32, C:\php, C:\php\ext, C:\Apache24, and C:\Apache24\bin. All of these directories are in PATH. When I run phpinfo(), CURL is not listed there at all. I've stopped and restarted Apache after all the changes. No luck. I still get the error

Fatal error:
Uncaught exception 'Exception' with message 
'Facebook needs the CURL PHP extension.' in C:\Users\...\sdk\src\base_facebook.php:19 
Stack trace: 
#0 C:\Users\...\sdk\src\facebook.php(18): require_once() 
#1 C:\Users\...\index.php(46): require_once('C:\Users\Jew\Do...') 
#2 {main} thrown in C:\Users\...\sdk\src\base_facebook.php on line 19

EDIT #1:
Also, I'm not using WAMP server.

EDIT #2:
I added mod_ssl to httpd.conf like this: LoadModule ssl_module modules/mod_ssl.so

Now phpinfo() shows

SSL: Supported

and

OpenSSL support: disabled (install ext/openssl)

Edit #3: I just found the following errors in my Apache error.log.

PHP Warning:  PHP Startup: Unable to load dynamic library 'c:\\php\\ext\\php_curl.dll' - %1 is not a valid Win32 application.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'c:\\php\\ext\\php_openssl.dll' - %1 is not a valid Win32 application.\r\n in Unknown on line 0

Edit #4: I've tried using mod_ssl, but the apache log gives the same error as it does for loading curl. I've taken all that stuff back out.

I've also tried using both of the 5.4.13 versions of php_curl.dll from anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows as well as the original that came with PHP 5.4.11 Thread Safe version.

Chris
  • 2,619
  • 6
  • 27
  • 34
  • Any errors on startup? Does `php_curl.dll` exist in extension dir ? – Mihai Iorga Feb 21 '13 at 07:26
  • No errors on startup. php_curl.dll is in C:\php\ext. Also, the dll is the 5.4.13 version from http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/ – Chris Feb 21 '13 at 07:30
  • And you are sure you edited the right `php.ini` that displays on `phpinfo()` ? – Mihai Iorga Feb 21 '13 at 07:33
  • `phpinfo()` shows `Configuration File (php.ini) Path: C:\Windows` and `Loaded Configuration File: C:\php\php.ini`. I actually edited them both. The correct one to edit is `C:\php\php.ini`, correct? – Chris Feb 21 '13 at 07:37
  • Yes, that should be correct. Strange ... – Mihai Iorga Feb 21 '13 at 07:51
  • I tried adding `LoadModule ssl_module C:\Apache24\modules\mod_ssl.so` to `httpd.conf` as per this post: http://stackoverflow.com/questions/2662336/could-not-load-php-curl?rq=1. Apache wouldn't start with that line in. I did verify that `mod_ssl.so` did exist in that directory. – Chris Feb 21 '13 at 07:54
  • Never mind. I got `mod_ssl` to work. See **Edit #2** above. – Chris Feb 21 '13 at 08:01
  • I was wrong! There was an error. I just found it in the Apache logs. Sorry. Check **Edit #3** – Chris Feb 21 '13 at 08:22
  • 1
    You are talking about `mod_ssl.so`. `.so` files are dynamic linked libraries for **Linux**. Are you sure that you are using `.dll` files for Windows? – hek2mgl Feb 21 '13 at 08:30
  • I just took out all the mod_sql stuff and that warning went away. I'm going to fix the question to reflect that. They are `.so` files in `C:\Apache24\modules`. I don't care about `mod_ssl` unless it's required. I am sure that I'm using `.dll` files. – Chris Feb 21 '13 at 08:38

2 Answers2

2

To sum up (if I didn't miss any detail) you have this:

  • PHP version 5.4.11, 32 bits
  • php_curl.dll version 5.4.13, 64 bits

That cannot work. Given that you have a 64 bit machine, I suggest you also use the PHP version from anindya.com so PHP and curl match. At such site you can also find 64 bit Apache releases.

Alternatively, use 32 bit releases of everything.

Álvaro González
  • 142,137
  • 41
  • 261
  • 360
  • I see what you mean. I'm downloading php-5.4.11-Win32-VC9-x64.zip from anindya.com right now, so we'll see how it goes. Initially I had no experience with anindya.com and didn't know if it was trustworthy. I'll definitely give you the credit if this works. – Chris Feb 21 '13 at 08:53
  • Just don't forget that you need 64-bit Apache to run 64-bit PHP. – Álvaro González Feb 21 '13 at 08:54
  • I was already downloading it. Also, IT WORKED! I feel stupid now, but at least it's working. Now I have a TON of old and wrong things to delete off my system so I don't get all confused. Thanks. You're a hero. – Chris Feb 21 '13 at 09:03
2

For 64bit W7 to install 32bit PHP Curl with Apache you could try copying php_curl.dll, libeay32.dll and ssleay32.dll to C:\Windows\SysWOW64.

Artx
  • 21
  • 3