Due to many included files create an error like instead showing the contents it only shows blank or one of the files has an error like no comma in the end of the script do not shows an error print like fatal error or syntax error in PHP?
I'm a bit worried cause i working on a site right now that has almost 20+ files to include from different directory.
I separated the files like a file that contains the page function, session functions, image function and other more.
I need some advice from anyone. Experts or not experts I really need to know this....
Sounds like you have error reporting turned off, i am not sure, if this is your question, though ;-). Put
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
at the very beginning of your script if you want to debug and don't want to change php.ini settings. Debugging like this on a production site is for obvious reasons not recommended, though (every visitor can see the error including sensible information, the error might contain).
It does not matter how many includes you have in your application -- 20 are not much, btw. -- you will always get the error together with the information in which line and which file it occured ...
Related
I'm playing with various ajax uploaders. When analyzing their server-side code, I see something like this:
#unlink($_FILES['file']['tmp_name'])
It is either muted one (like above), so does nothing (in my case) or unmuted one, so throws a warning, that access to temporary folder is prohibited (in my case) and breaks execution of a script.
What am I missing? I was always told, that we should not touch temporary files transmited via PHP form. Because this is unnecessary (and somethimes prohibited, like in my case). PHP will do all the cleaning, when script ends -- i.e. remove all uploaded temporary files.
What is the reason in code like above? Is it for the case, when script breaks, PHP is halted with some critical error and thus isn't able to remove temporary files? Or there is another reason?
Edit: It is quite pity, that I found this kind of mistake even in Plupload example code.
As per comments - there's nothing you've missed. Unlinking shouldn't be done by the user-code, such things might not be permitted and can fail due to various reasons.
Every MediaWiki has a load.php.
If called without parameters it returns:
/* No modules requested. Max made me put this here */
As a curious programmer I wonder:
Why did he do this?
I am sure in a big project like this there is a good reason for it. Looks to me like it would be bad to return an empty file to an ajax query or something like it.
BTW: Normally it is called with parameters like this: load.php?debug=true&lang=de&modules=user.options&only=scripts&skin=modern&user=pi&*
This message comes from ResourceLoader.php. In the history of the file, using git blame, you can see the code was written by Roan Kattouw (RK) in this changeset. From the changeset comment:
Make load.php output a comment explaining what's going on when no modules were requested rather than outputting nothing. Max made me do this because he hates blank pages
So, your answer is, because Max hates blank pages, and if you want to know more, you should ask Roan. My guess would be that it's a debugging aid; rather than staring at a blank page wondering why it's blank, at least you know that you did something that caused a module loader request to load nothing...
As #svick points out, there is also a link to the code review, including discussion of whether it's a good idea to mention Max at all. Mentioning Max was seen as a possibility to partially close MediaWiki bug 20281, which notes that there aren't enough Easter Eggs in MediaWiki.
And that's why public repositories of open source software are cool :D
It is just to know, whats going on.
If i browse the load.php file of my MediaWiki installation with my web browser and want to check if there are any errors, they may get displayed or leave me a blank page.
A blank white page indicates a PHP error which isn't being printed to the screen.
But if i see a comment thats similar to /* No modules requested. Max made me put this here */. i do know its alright
AND that is the reason, why they needed to diff it.
I'm getting an error showing up in my error logs over and over. I see it in an error log in cpanel as well as in an AW stats report.
The errors look like this:
/my_directory/'%20+%20protocol_host%20+%20'/images/greenthumb.png
/my_directory/'%20+%20protocol_host%20+%20'/images/imgsicon.png
I'm seeing this thousands of times a day.
the legit path in the example above would be something like this:
/my_directory/page.php?id=123454
(i.e www.my_site.com/my_directory/page.php?id=123454)
Any ideas what this protocol_host is referring to and why it would be hitting my error log so often?
My research before posting this question led me to something related to the search indexer on a windows operating system computer, but I can't see the connection.
Thanks in advance as always
I'm with #Shal. Although google gives you some results for 'protocol_host' I don't think that they are related to your problem. I guess it is either an error in your PHP code which generates the links or an erroneous client (or a hacker) is accessing your site
Looking at the error-URLs, it seems like the paths to some images are generated dynamically by concatenating strings; but the quotes are note set correctly.
/my_directory/'%20+%20protocol_host%20+%20'/images/greenthumb.png
without URL encoding is
/my_directory/' + protocol_host + '/images/greenthumb.png
PHP uses . to concatenate strings, but here a + is used. So I would guess that some JavaScript code causes this error.
Check your JS resources!
I would guess, that you are linking some resources relatively without a leading slash.
example:
<img src="images/foo.png" />
usually this leads to urls like http://example.com/images/foo.png instead of http://example.com/my_project/images/foo.png but can have other conseques as well.
This is just a guess though.
I recently purchased this script from Code Canyon and I want to work it in to my Warp Joomla template.
http://www.geertdedeckere.be/shop/thumbsup/help#template-list
I hope someone on here has some experience with the Warp framework. I have followed the creator's instructions to the T but I keep getting a white screen. Each Warp template is based on a config.php and template.config.php file. I have tried adding code as outlined on YooTheme support ticket: http://www.yootheme.com/support/question/28978 with no avail.
I also tried doing some other experiments, but while I wait on YooTheme's ridiculously long support response, has anyone the slightest idea of how I can call the initial PHP function and the CSS/Javascript files in my Warp template? I managed ot get as far as the CSS (I am unsure whether or not the init.php call is being seen, even with a relative path. The creator's original commands:
<?php echo ThumbsUp::css() ?>
<?php echo ThumbsUp::javascript() ?>
Are giving me a white screen, which I assume (and I don't know PHP inside and out / but I am tech literate) is because either the original call is not being placed before all other content output, due to a joomla structural issue I am not aware of (i.e. I am putting the code in the wrong place), or I am incorrectly placing the echo commands. Please help!
You haven't mentioned a Joomla! version so I'm presumming 2.5.x in my comments.
Putting this type of functionality in a Joomla! template is not a good idea, you would be better off looking at one of the existing extensions for Joomla! that provide "Ratings and Review" functionality including simply like/dislike options. The majority are free.
Having said that to determine the root cause of a PHP problem you will need to do the following:
Turn on "Debug System" (Site->Global Configuration->System->Debug Settigns)
Turn the sites "Error Reporting" level up,(Site->Global Configuration->Server->Server Settings). If it's currently None the start with Simple and work your way up (unless you're completely confident that you can log in modify the configuration.php file manually if the site stops working after ramping the error reporting all the way up.
N.B. Do not leave these settings on for any longer than necessary.
From the output generated you should be able to pin point the error, or the area the problem is occurring in. At that point you could extend your original question and provide us with more details like the error message, the code that causing it etc...
My site has a php page that prints out XML, for some reason though it's being truncated to 8KB in size, I've never encountered this before and all the other pages on the site remain un-truncated.
Where should I start looking for the problem and what could cause it to stop like this?
The site uses the Zend framework and the page in question uses the soap server.
Put this before the section where the output cuts off:
error_reporting(E_ALL);
ini_set('display_errors', 1);
Chances are there is just an error that is not being output. Also make sure your code does not contain the error suppression operator (# symobl) as this is a common cause of hard to detect errors: http://www.php.net/manual/en/language.operators.errorcontrol.php
If my first suggestion fixed your issue then I would suggest that you set up and test error handling correctly so that you will receive all errors in the future as this will save you a lot of time.
I'd expect an error if it was memory but have you tried increasing the memory limit in php.ini?
It could be some memory limit, it could be some arbitrary part of the script that is running at that part of the XML creation.
Check what errors you are getting, see if any errors are suppressed. And if all else fails, post some example code that is running at that 8KB mark.