drupal-6


Drupal: What is wrong with my base_path to my libraries folder


I get the following error:
Warning: require_once(/libraries/recaptchalib.php): failed to open stream: No such file or directory in eval() (line 3 of /home3/quikappd/public_html/rulpon/modules/php/php.module(80) : eval()'d code).
In drupal 6 I am attempting to add captcha to an old content type that has a php html form built into it. I add the captchalib file to the library folder in my drupal instance, but I keep getting the error message noted above. I have tried dirname, base_path and various other urls to get to the folder. What am I do wrong?
This is what I had for base_path -> require_once(base_path().'libraries/recaptchalib.php');
then this for dirname -> require_once ( dirname(__FILE__) . '/libraries/recaptchalib.php');
then just straight url -> //require_once('decon.com/sites/all/libraries/recaptchalib.php');
According to base_path() doc, it returns an URL segment. For example, if the drupal site homepage is on http://www.example.com/foobar, it would return /foobar
That's why it doesn't help in locating an include file with php.
When knowing where the file is relative to document root, you may use:
require_once($_SERVER['DOCUMENT_ROOT']."/site/all/libraries/recaptchalib.php");
Or if the file is part of a module, a better method is be to locate it through:
drupal_get_path('module', 'name-of-module')

Related Links

Drupal 6 How to hide fileds on creating content but show on editing content?
Drupal 6 - creating full page content with no sidebars within
Node save with multiple taxonomy field of different vocabulary in drupal 6
Hybridauth module social network icons not working with user/register page drupal 6
Is there a way to make an online customer tax exempt?
How to put two form elements in a row using Drupal Form API?
Increase memory_limit of subdomains in the plesk panel
Cart items missing after login, drupal6 with ubercart
How to disable “Read more” link in product description? (ubercart, drupal6)
How to configure site created in drupal on some other machine to be run on localhost of another machine
How to have different style files in multilingual website using Drupal 6?
scrollable views in drupal 6 is needed
hook_comment is not working for update operation in drupal
Drupal 6 - Image gallery image popup when navigating site?
How to put two cck fields in add content page in drupal 6
drupal block variable_set not saving select value

Categories

HOME
proxy
mockito
layout
filtering
cakephp-2.5
jxls
umd
webpack-2
installshield
acquia
indesign
constraint-programming
medical
elasticsearch-hadoop
node-pdfkit
moonmail
commonmark
messages
jsprit
lombok
apache-metamodel
code-review
jprofiler
dbext
riot.js
microsoft-chart-controls
iframe-resizer
google-qpx-express-api
copying
kendo-ui-grid
uiswipegesturerecognizer
environment-modules
nssegmentedcontrol
simplexml
git-merge
hilbert-curve
ssjs
impersonation
lumberjack
fakeiteasy
arena-simulation
xml-documentation
osx-mavericks
smartcontracts
boost-multi-index
diagnostics
pg-dump
angular-cache
grails-tomcat-plugin
android-textview
slicknav
home-directory
database-optimization
adxstudio-portals
dstu2-fhir
merge-conflict-resolution
paypal-express
autorest
player
markojs
apachebench
ios4
asp.net5
netmq
icu4j
skos
csquery
gwidgets
qpainter
eol
bundles
jboss-weld
hyprlinkr
message-driven-bean
runtime.exec
shellexecute
eventual-consistency
sharp-repository
android-hardware
objective-c-2.0
qtkit
work-stealing
boost-filesystem
gnustep
hamachi
cinema-4d
krl
yslow
sudzc
sortable-tables
dbal
rescale
temporal-database
django-notification
3gp

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App