473,785 Members | 2,994 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Host says "Check php include path"

8 New Member
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.getima gesize]: failed to open stream: No such file or directory in /home/games4w/public_html/games/system.class.ph p 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.ph p, here is line 430 of that file:

list($imagewidt h, $imageheight, $itype, $iattr, $imime) = getimagesize($t his->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 2549
Atli
5,058 Recognized Expert Expert
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
Gutspiller
8 New Member
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
Gutspiller
8 New Member
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($imagewidt h, $imageheight, $itype, $iattr, $imime) = getimagesize($s wfPath);

Any ideas?
Apr 22 '10 #4
Atli
5,058 Recognized Expert Expert
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
Gutspiller
8 New Member
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 Recognized Expert Expert
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
Gutspiller
8 New Member
@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 Recognized Expert Expert
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
Gutspiller
8 New Member
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_2 6th_2010.swf

and

Home-Sheep-Home_february_2 6th_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_2 5th_2010.swf) [function.getima gesize]: failed to open stream: No such file or directory in /home/games4w/public_html/games/system.class.ph p 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

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

Similar topics

43
5129
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 relative NOT to the immediate script that is including it, but is relative to the top-level calling script. In practice, this means that you have to constantly worry and adjust paths in includes, based on the startup scripts that call these...
2
2941
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 driven. The regex would include if/then/else type logic, and would like my script to conditionally execute the logic. -- http://www.dbForumz.com/ This article was posted by author's request
4
2882
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 this #include statement... <!--#include file="../include.inc"-->
18
2633
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> Assume that this library will be used by other groups. I think the answer
2
1874
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
3015
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 this: #include "pathname/file"
1
5434
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 open in designer. Illegal characters in path" and the file is instead opened in HTML view. I don't know what application or situation may have caused this error. I looked on the newsgroups and noticed that numerous other people were having this...
5
7223
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 'D:\appfolder\test2'. ASPNET has full control on the application folder. Any ideas why this fails? - Tom
2
5114
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 run from the context of a user control. Is this the best way to do this by rebuilding the url from the client request?
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10330
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10153
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10093
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9952
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8976
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7500
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2880
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.