473,410 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

Host says "Check php include path"

I am new here (Hello!), I am trying to fix a problem that some of the pages of my site are displaying the following error:

Warning: getimagesize(./swf/FWG Bridge_july_4th_2008.swf ) [function.getimagesize]: failed to open stream: No such file or directory in /home/games4w/public_html/games/system.class.php on line 430

The thing is some pages aren't.

On the pages that display the error, it's not loading up my content either (flash games).

I talked to my host about this and they said "Please update the programmer to check the php include path in the scripts."

I'm hoping I might be able to get some help in resolving the problem without paying a php programmer, as it sounds like it might just be a line of code that contains a path incorrectly.

The above mentioned error notes line 430 in system.class.php, here is line 430 of that file:

list($imagewidth, $imageheight, $itype, $iattr, $imime) = getimagesize($this->swfdir."/".$game['game_swf']);

I already know some people have "claimed" that getimagesize only works with images, but I guess it doesn't because other flash games on the site work just fine, and getimagesize does fine the correct proportions to the games.

Can anybody please help? I am not a php programmer, but I can follow any directions of copying lines of code here, or replacing certain ones. Any help would be appreciated.

Thank you!
Apr 21 '10 #1
12 2506
Atli
5,058 Expert 4TB
Hey!

Looks like there might be an extra space there, after the name of the SWF file.
Try replacing the line with these two:
Expand|Select|Wrap|Line Numbers
  1. $swfPath = $this->swfdir . '/' . trim($game['game_swf']);
  2. list($imagewidth, $imageheight, $itype, $iattr, $imime) = getimagesize($swfPath);
Apr 21 '10 #2
Amazing. Thank you very much. You saved me from having to hire a programmer to fix this small little error.

Quick, and accurate. I think I found a new php help forum. :)
Apr 21 '10 #3
Hmm, looking at more game pages, it appears that didn't solve all the issues. I found out that now other pages display the error still, but this time it says line 431, which is this:

list($imagewidth, $imageheight, $itype, $iattr, $imime) = getimagesize($swfPath);

Any ideas?
Apr 22 '10 #4
Atli
5,058 Expert 4TB
Ok, past the error here exactly like it appears on the page. (Within [code] tags, preferably, so we can see all the white-spaces.)
Apr 22 '10 #5
The error:
Expand|Select|Wrap|Line Numbers
  1. Warning: getimagesize(./swf/Climb or Drown_april_7th_2010.swf) [function.getimagesize]: failed to open stream: No such file or directory in /home/games4w/public_html/games/system.class.php  on line 431



Line 430 and 431 of my actual code:
Expand|Select|Wrap|Line Numbers
  1.             $swfPath = $this->swfdir . '/' . trim($game['game_swf']);
  2.             list($imagewidth, $imageheight, $itype, $iattr, $imime) = getimagesize($swfPath);

Thanks for any more help!
Apr 22 '10 #6
Markus
6,050 Expert 4TB
Hi, Gutspiller (lovely name :P)

Why don't you find out what the full path is resolving to:
Expand|Select|Wrap|Line Numbers
  1. print realpath($swfPath);
  2.  
You'll then see if this path looks valid or not.
Apr 22 '10 #7
@Markus
I put that in right under line 431, and on the game pages that give errors, it didn't display anything new, but on pages that work and display the games just fine I got this:

Expand|Select|Wrap|Line Numbers
  1. /home/games4w/public_html/games/swf/Truffle Hunter_april_21st_2010.swf 
That path to the game does exist, and looks right, but so do the paths to the files that give errors too.
Apr 22 '10 #8
Atli
5,058 Expert 4TB
The realpath function should return a file path on all the pages. The only reason for it not to return a path is if that file doesn't exists or is inaccessible.

Do this, and show us the output (from the source):
Expand|Select|Wrap|Line Numbers
  1. $swfPath  = $this->swfdir . '/'  . trim($game['game_swf']);
  2. echo "<pre>", var_dump($swfPath), var_dump(realpath($swfPath)), "</pre>";
  3. list($imagewidth, $imageheight, $itype, $iattr, $imime) = getimagesize($swfPath);
Also, make sure the file has proper permissions, so that PHP can access it.
Apr 23 '10 #9
I have discovered more of a problem then I ever thought possible... but I still need help.

After doing more research and talking with my host, here is what's happening.

To publish games I upload their game file (.swf) and their thumbnail to the server. While doing this I manually add a date to the file. For example:

Home Sheep Home_february_26th_2010.swf

and

Home-Sheep-Home_february_26th_2010.jpg

Everything is fine so far, and these files exist on the server in their proper folders, but here's where something strange happens.

The error on the page that is attempt to call this flash game is this:

Warning: getimagesize(./swf/Home Sheep Home_february_25th_2010.swf) [function.getimagesize]: failed to open stream: No such file or directory in /home/games4w/public_html/games/system.class.php on line 431

If you don't see it, the error has the date in the .swf file as _february_25th_2010.swf while the actual date in the filename is _february_26th_2010.swf

Perhaps somebody can shed some light on how this is happening, and how to fix it?

I have one theory, a month or so ago, I hired a programmer to add a caching system to our site.

Is it possible, that he saw these dates on the files that needed to be cached, and thought that they were generated automatically by the date of the server?

If this is possible, then is it possible for you php coders to give me some hints of commands that he may have had to use in my files, that I might be able to search for so I could take it out, or even better, so I could paste the suspected code snippets here, and you tell me if it's doing what I have my theory about?

Please help! I desperately need to fix this problem, and am hoping that I don't have to go back and fix all the entries in my database if it's permanently changing all these dates.
Apr 23 '10 #10
@Atli
When i added that code in replacement of the other 2 lines I get this at the top of the page:

string(41) "./swf/Da Vinci Cannon_march_28th_2010.swf"
bool(false)


Warning: getimagesize(./swf/Da Vinci Cannon_march_28th_2010.swf) [function.getimagesize]: failed to open stream: No such file or directory in /home/games4w/public_html/games/system.class.php on line 434

A different game page, but still one that was giving the same error as the others I've mentioned.

Does this give you any ideas?
Apr 23 '10 #11
Atli
5,058 Expert 4TB
Ok, so the filename is invalid.

Can you show us where the $game['game_swf'] variable in your code is defined; where the $game array is set.

If there is a problem with the dates; that the caching feature is using the incorrect date, then you need to alter the code that does that to use the "static" date instead. - But to do that you need to find the code that fetches the real date and the code that creates the $game['game_swf'] value.
Apr 23 '10 #12
line 411
Expand|Select|Wrap|Line Numbers
  1.         $content->set('game_swf',$this->swfdir."/".$game['game_swf']);
413
Expand|Select|Wrap|Line Numbers
  1. $games_swf = $game['game_swf'];
416
Expand|Select|Wrap|Line Numbers
  1. $content->set('game_swf2',$this->swfdir2."/".$game['game_swf']);
430/431 - (The ones I've been posting)
Expand|Select|Wrap|Line Numbers
  1.             $swfPath = $this->swfdir . '/' . trim($game['game_swf']);
  2.             list($imagewidth, $imageheight, $itype, $iattr, $imime) = getimagesize($swfPath);
Those are all the lines in my system.class.php file that contain $game['game_swf']. Searching all the files for my site, and $game['game_swf'] doesn't appear in any other files.

As far as finding the code that is changing the date, do you have any ideas on words to search for? That, or maybe if you are still willing, I could attach my system.class.php to a PM? I am sorta thinking it's somewhere in there.
Apr 23 '10 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

43
by: steve | last post by:
I am quite frustrated with php’s include, as I have spent a ton of time on it already... anyone can tell me why it was designed like this (or something I don’t get)? The path in include is...
2
by: steve | last post by:
Hi, I need to do conditional script "include", but like to pull the code from db instead of a file. How do I do that? Reason: I like to implement some complex regex logic, and make it table...
4
by: michaaal | last post by:
I have two folders in my website... Folder1 (this is where my #include file is, this is where the style.css is) --Folder2 (Folder2 is inside of Folder1) Folder2 contains a file that has...
18
by: Tuckers | last post by:
My question is, if I have created my own library which lives in its own install directory, to refer to its header file is it better to use #include "MyLibrary.h" or #include <MyLibrary.h> ...
2
by: Martin Hvidberg | last post by:
Dear list I have found a declaration like this: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <math.h> #include "ectemp.h"
2
by: Susan Baker | last post by:
Hi, I am (trying) to compile some code I downloaded from the internet. The sources contain references to header files - using the form : #include <pathname/file> If I change the form to...
1
by: Steve Grahovac | last post by:
I have been having trouble the last few days opening any ASP.NET web forms in the design view in the designer. Every time I clicked on an aspx file I got a message box with the error "Unable to...
5
by: Tom Vogel | last post by:
Creating a subfolder within my ASP.NET application folder fails with the above error, but only at my hosting provider. The command: Directory.CreateDirectory(path) Path is set to...
2
by: Nathan | last post by:
I need to take a path "~/" and get a http://localhost:port/rootappfolder/ url out of it. Currently I'm using: Request.Url.Scheme + "://" + Request.Url.Host + this.ResolveUrl("~/"); //this is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.