I am trying to setup a local version of a website that I can do some testing on. Currently when I open the site in my browser I get this php error:
( ! ) Exception: Facebook needs the CURL PHP extension. in
C:\wamp\www\mysie.tld\includes\facebook-graph\base_facebook.php on
line 19
So I did a bit of reading up and saw that this was most likely due to my WAMPserver not having the extension enabled for PHP. I did a phpinfo() and this output the .ini file that was being loaded.
C:\wamp\bin\apache\apache2.4.2\bin\php.ini
I opened this file up in my text editor and removed the semi colon before this line:
extension=php_curl.dll
I then restarted the WAMPServer and reloaded my site. Unfortunately, the error persisted and I do not know what I can do to fix it! Any help would be much appreciated.
Managed to figure it out with a quick scan through some similar questions on SO. If anyone is running into the same issue it was due to a bug in the curl.dllfile that came with WAMP 2.2. In order to rectify the issue I downloaded the php_curl-5.4.3-VC9x64.zip from this link:
https://code.google.com/p/justintung/downloads/detail?name=php_curl-5.4.3-VC9-x64.zip&can=2&q=
I then moved and replaced the curl.dll file in the downloaded folder with the curl.dll file located in my php ext directory.
Restarted WAMP and the problem was resolved.
Related
I have been a happy user of XAMPP for years,
but today I have updated to the latest Windows 32 bit version on a Windows 10 machine.
I couldn't see a 64 bit version.
Anyway, all went well,
and once I changed some settings, I was able to see all my old databases under the new phpMyAdmin.
But my PHP scripts are bombing out before they start.
Even phpinfo gives the same error message, which is...
"Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'F:/My Documents/OneDrive/Webs/htdocs/index.php'
(include_path='.;C:/xampp/php/pear/PEAR') in Unknown on line 0"
The test script of index.php is nothing more than
<?php echo "HELLO"; ?>
The statement in php.ini is
include_path = ".;C:/xampp/php/pear/PEAR"
and there are no other include_path statements.
The directory C:/xampp/php/pear/PEAR does exist.
The index.php file is there.
I don't know why there's a PEAR folder inside a pear folder - that's how Xampp installed it.
I have tried all variations of that include_path statement to no avail.
I have left out one of the pears.
Leaving out the include_path statement altogether just results in the PHP default which is a folder which is definitely not there, so that's no good.
My localhost is inside the OneDrive folder as you can see from the error message, but I have been doing it that way for years.
Now I cannot run any PHP scripts. Pure HTML is no problem.
The new installation of Xampp has totally replaced the old one, and its Control Panel v3.2.2 looks to be working perfectly.
phpMyAdmin seems to be working fine, but not phpinfo, as said.
I have scanned the web for answers to this, and there is plenty of forum Q&A's, but they all tell me to do what I have done.
The computer is Windows 10 Pro, and is fully up to date. Apache 2.4.33.
PHP 5.6.35. Database server is 10.1.31 MariaDB.
I've run out of ideas. Any help will be appreciated.
Thanks Mike.
You need to fix your include_path system variable to point to the correct location.
To fix it edit the php.ini file. In that file you will find a line that says, "include_path = ...". (You can find out what the location of php.ini by running phpinfo() on a page.) Fix the part of the line that says, "\xampplite\php\pear\PEAR" to read "C:\xampplite\php\pear". Make sure to leave the semi-colons before and/or after the line in place.
Restart PHP and you should be good to go. To restart PHP in IIS you can restart the application pool assigned to your site or, better yet, restart IIS all together.
first: check all the paths in the php. ini ( use a search or a grep to check them)
second: check that you don't have any extensions added twice (one in the beginning and one in the end of the file)
There is a lot of topics on this but after hours of reading i am still getting no where.
I have found a lot of issues wit this.
people have given links to files that no longer exist
the help people have given refers to files that aren't included with the download
This is the nearest i have found
link
I followed this exactly, after finding a different version of the file broken link
version I found version available at sourceforge which isn't very helpful.
Steps as decribed:
unzip
copy ffmpeg.exe somewhere and remember the path for later use
move php_ffmpeg.dll to php extension dir (usually c:\xampp\php\ext)
move all other files to Windows\System32 (except COPYING.GPLv3.txt,
readme.txt)
add extension=php_ffmpeg.dll to php.ini (usually
c:\xampp\php\php.ini)
restart apache with fingers crossed questions/answers
http://www.apachefriends.org/f/viewtopic.php?f=16&t=41913
But when I restart apache I get the error:
The program can't because avcodec-51.dll is missing
AND
PHP startup: Unable to load dynamic libary php_ffmpeg.dll can't be found
The php_ffmpeg file is in the apache extention folder and has been declared in the php.ini file. I don't really change many settings in my php.ini file so I just put iy at the top of the extentions, if this is the problem please let me know.
extension=php_ffmpeg.dll <---first extention added
extension=php_bz2.dll <---- this was allready there
If anybody knows an easy way to install this on a localhost I would really appropriate and if I'm having this much trouble on localhost should I bother trying to get this working on my lunix server.
(I am using xampp on windows and my lunix server is hosted through 1and1 - not my first choice but its for a friends site)
I created my php file as .bat file using
#ECHO OFF
php -f D:\wamp\www\scrapper\scrapper5.php
I used cURL in scrapper5.php, when i run .bet file manually i got and error
call to undefined function curl_init() in your file
I researched and i got cURL is not working in CLI mode.
I just follow below step but can't get success.
Run a php script as a background process in wamp server
How can i run batch file with cURL?
Can anybody give me solution?
From the error you have posted, it looks like you do not have cURL installed. Perhaps look at you CLI config for PHP and see if the curl module is active
Wamp may not have cURL installed by default - have a look at options for installing it on your system.
If i remember correctly, you should have a menu (right click on the wamp icon) for enabling/disabling apache modules. Have a look there for cURL and enable it. (sorry if this is a bit vague, I'm on a mac at the moment and on Windows it has been several years since I moved form WAMP to XAMPP)
If that doesn't work, some forums seem to mention downloading the cURL extension (on windows this is a .dll file) from here: http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/ and putting that in your ext folder under the WAMP instal directory. Just make sure to get your versions correct to ensure stability.
I think you have to enable cUrl feature in wamp server. Follow those steps may it will help you:
1. Go to wamp Server Tray icon which is placed in the task bar.
2.Open PHP Tab.
3.PHP Extensions.
4.Then make sure PHP_CURL is selected.
5.Then restart wamp server.
I hope it will help you!!!!
I'm facing problem to load the php_oauth.dll extension for my xampp. I downloaded the php_oauth.dll and added extension=php_oauth.dll in php.ini , but when i restart my apache, it cannot start the server anymore.
I'm using window 7 ,64bits.
Initially, I download the file from
http://downloads.php.net/pierre/
but i found that it was 32bits file , so I'm searching fo 64bit and found out
http://www.mediafire.com/php-win64-extensions
unfortunately,I still cannot load the oauth. Any solution to solve it? I look through many article, but it seems like dont have it, anyone can provide ,so that, others that using win 64bit can follow
Thank you!
This looks to be like a path problem. Make sure the extension is store in the correct extension directory.
The settings of this can be found inside php.ini as something like
extension_dir = C:\php\extensions
By default this is ext folder inside PHP installation.
Or, follow the instruction from PHP manual while installing extensions, if you are not sure what you are doing.
I was asked to fix a site that was fine just days ago and now is not able to include files due to the host's upgrade of the PHP to v.5.3
There's a script that reads directory and builds a list of PDFs in it. FOr some reason the script stopped working and I get the following error messages:
failed to open dir: No such file or directory...
However I see the directory on the server and if I point to a file directly it opens.
Earliuer I had an issue when I was trying to include files and was getting somewhat similar messages. It seems the problem is caused by a deprecated php.ini setting: register_globals = on. in PHP 5.3
What are the possible solutions?
May be this dir was in old php.ini include_path directive