Php


#1

This is my first domain and I am confused about something.

Do I have to install something so I can use certain php includes on my site?

I noticed that when I try to use certain wordpress plugins they don’t work.
When I try to have php in my index file it doesn’t work.
When I try to use a script… It doesn’t work.


#2

Nothing to install, php is ready for you to use. Just rename your files so they have the php extention. Ex. index.html would be renamed to index.php.
Also you can use a htaccess file to tell Appache what extentions will be a valid php type.
http://www.php.net/manual/en/security.hiding.php
Silk


#3

Yea I know that but my files are .php. When I tried adding a php include on my index.php file I got an error. I know the include was write because I tested it on my hosted site on another sever not dreamhost.

For some reason some wordpress plugins that work for my hosted site don’t work for the domain… its weird.


#4

Are they trying to access other websites? If they are then they need to use curl. As allow urlfopen is disabled.
Silk


#5

I got an error

What exactly does the error message say? What are you trying to do when you get this error?

We can guess all day long but without more detailed information you’ll be lucky if anyone even comes close to solving your problem.


If you want useful replies, ask smart questions.


#6

Nope, they aren’t trying to acess other websites.
For one I used a basic php include to include my own wordpress blog (on my domain hosted here) to my index page, which usualyl works. I found a way around it .

One of the plugins errors. It works on my other site w/ teh same plugin & wp but on this one:

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of xml_parser_set_option(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. inhome/.g*****/mysite/my site/wp/wp-content/plugins/now-reading.php on line 866

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of xml_set_object(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in home/.g*****/mysite/my site//wp/wp-content/plugins/now-reading.php on line 867

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of xml_set_object(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in home/.g*****/mysite/my site//wp/wp-content/plugins/now-reading.php on line 867

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of xml_set_element_handler(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. inhome/.g*****/mysite/my site//wp/wp-content/plugins/now-reading.php on line 868

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of xml_set_character_data_handler(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in home/.g*****/mysite/my site/wp/wp-content/plugins/now-reading.php on line 869

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of xml_parser_free(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /home/.g*****/mysite/my site//wp/wp-content/plugins/now-reading.php on line 871

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of xml_parse(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /home/.g*****/mysite/my site/wp/wp-content/plugins/now-reading.php on line 876

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of xml_parse(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /home/.g*****/mysite/my site/wp/wp-content/plugins/now-reading.php on line 876


#7

Those are not so much errors that are going to stop the plugin working as (as they say) warnings to indicate that you may want to make a change or not to the plugin as it may not work in the future.
Pass the name and details of the plugin for your wordpress blog and perhaps someone else has had problems with it. It may just be a way that Dreamhost has some setting or other in the php.ini file.


Norm


#8

That makes since for that but what about when I use a basic php include and get this everytime:
Warning: main() [function.main]: URL file-access is disabled in the server configuration in home/.g*****/******/mysite/index.php on line 1

Warning: main(http://wp/index.php) [function.main]: failed to open stream: no suitable wrapper could be found in /home/.g/****/mysite/index.php on line 1

Warning: main() [function.include]: Failed opening 'http://www.*/wp/index.php’ for inclusion (include_path=’.:/usr/local/php5/lib/php’) in /home/.g*****//mysite/index.php on line 1

Basically the include is including a folder on my site. Which I have done before on other sites so that is why I was wondering if there was something I had to install.


#9

For includes use a relative directory rather than absolute.
example: instead of using
include (‘http://www.example.com/temp/example.php’);
use
include (’/temp/example.php’);
This has to do with allow url fopen being disabled.
Silk


#10

[quote]For includes use a relative directory rather than absolute.
example: instead of using
include (‘http://www.example.com/temp/example.php’);
use
include (’/temp/example.php’);
This has to do with allow url fopen being disabled.[/quote]
I’m sorry, but that just isn’t correct. You can only use true relative paths (do not begin with a slash) or true absolute paths (relative from the root directory), which leaves you with choices like these:include("temp/example.php"); include("../temp/example.php"); include($_SERVER['DOCUMENT_ROOT']."/temp/example.php");The latter of these is the way to go. See this article for more details.


Simon Jessey
Keystone Websites | si-blog


#11

Yep, your right. I am so use to using the slash in other parts of php. Also my includes I keep in my root folder.
Good catch, better than having toyomo fiddling for hours. Sorry for that.
Silk


#12

Thanks I got it