My site was working all fine on localhost but since when i have uploaded. It is showing an error
include(CHTML.php) [<a href='function.include'>function.include</a>]:
failed to open stream: No such file or directory
I am searching it since long and did many things for it..
Like importing 'system.web.helpers.*' in main.php,Still its not working.
Please somebody help and do help in detail, am new to YII.
Thanks in advance.
Is your local machine Windows and your remote server a *nix box? In that case, check your capitalization. CHTML.php suggests that you have case-mismatches, try using CHtml in your code instead.
Dev in Windows, deploy into Unix: Case sensitive issue.
Related
I have two machine (LapTop & DeskTop),
so I use WWW in a cloud OneDrive folder,
pro easier synchronisation.
Strangely I didn't had any trouble until june,
when I installed the last Windows 10 2019 Creator Update…
I formatted my C drive and installed the update,
but the problem is that I use an other drive of 1To pro my OneDrive files (with 1To subscription),
and of course in properties,
the authorisation using my login who is linked to my Hotmail,
was not recognized,
and shown as a long number
I changed all authorisation with the actual login.
But now when I launch a php page on local host, I get this message :
Laragon
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'I:/Users/nemza/OneDrive/www/taocodex/templates/ueb/wp/converter/WP_converter_18_columns.php' (include_path='.;C:/laragon/etc/php/pear') in Unknown on line 0
wamp64 :
( ! ) FWarning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
( ! ) Fatal error: Unknown: Failed opening required 'I:/Users/nemza/OneDrive/www/index.php' (include_path='.;C:\php\pear') in Unknown on line 0
I can't find a solution on Google, and I know that before it was working, I don’t have trouble with HTML files,
any solution ?
Don’t tell & answer me to use www in Laragon folder, I don’t want to do this.
Few day after,
I have formated the I:\ drive, and reinstalled and downloaded the OneDrive files.
But I still have this problem ?
If use i:\users\nemza\www it's working fine,
if use i:\users\nemza\OneDrive\www, not.
{Image refused because not 10 of reputation.}
What are the "security setting" that I should use ?
What is the problem ?
I written in Laragon forum without any response !
Any advice please ?
Can someone help please ?
Thank you, good day.
Changed security settings in properties.
Reinstalled application with administrator power.
Formatted the drive.
added path ".;C:\laragon\etc\php\pear" & "C:\laragon\etc\php\pear" in System & User Environment variable, with no success.
Asked a friend to install Laragon, and set WWW in OneDrive, exactly the same problem.
If you don't want to use default www folder of laragon try any other folder outside Onedrive. you can do c:/www.
If you want to use Onedrive for syncing purposes i do recommend to use git instead
If you want to collaborate with somebody i do recommend to use following addons of VScode Live Share or Remote Development (Depends on use case)
I wrote above based on my experience and reasons why i wanted to use Onedrive for my code projects, even if you find a way to make it work again with Onedrive i do not recommend using it for servers, code or basically any project with multiple files that are being updated frequently.
I had cases of syncing issues where files were not uploaded fully on the server not showing any signs of errors, or onedrive corrupting files inside my local environment.
No issues so far for regular use, like archiving, syncing images or working with office documents.
this problem is driving me nuts. I know similar problems has already been submitted but no solution worked for me
I'm getting this error:
Warning: include_once(): Failed opening
'Recruit/Model/DbTable/Volontari.php' for inclusion
(include_path='/var/www/html/fabio/recruit/application/../library:/var/www/html/fabio/recruit/library:.:/usr/share/pear:/usr/share/php')
in /usr/share/php/Zend/Loader.php
But actually file exists on server. This is part of my folder tree
source
|__application
|_ ....
|__library
|__Recruit
|__Forms
| |__VolontariCreate.php
|__Model
|__DBTable
|__Volontari.php
Form VolontariCreate.php works, so I don't think it can't find the path.
I also checked include paths with echo get_include_path();
and they're correct
If it can help, client is Ubuntu, server is Centos, zend version is 1.12.17dev
Thanks for your support.
I believe your problem is that linux/unix file systems are case sensitive. On servers running Windows you can get away with whatever file case you fancy as they are case insensitive. As such your request to include:
Recruit/Model/DbTable/Volontari.php
Will fail because the actual path should be:
Recruit/Model/DBTable/Volontari.php
Notice the capital B in DB...
So long story short, I finally made the switch from Windows to Mac. I installed XAMPP on my new computer and have everything working. Now I am transferring local WP installs from my old computer and found this error...
Fatal error: require_once(): Failed opening required
'/Applications/XAMPP/xamppfiles/htdocs/mysite/wp-content/plugins/essential-grid//admin/includes/update.class.php'
(include_path='.:/Applications/XAMPP/xamppfiles/lib/php') in
/Applications/XAMPP/xamppfiles/htdocs/mysite/wp-content/plugins/essential-grid/essential-grid.php
on line 133
2 things. First, this isn't a problem with the plugin files themselves because they work fine on the local and live sites. Second, I highlighted where I think the error is here "essential-grid//admin", but I'm not really sure what is causing it. Is there something I need to change in my new XAMPP config?
I'm guessing it's probably a simple configuration that I'm missing. Thanks in advance.
Turns out the files got corrupted during the file transfer so this wasn't a problem with XAMPP. Everything worked out.
I have to website with a very similar php configuration (actually on the same hosting account), with almost identical php code and with identical file structure. At some point, I call fopen(http://example.com/rssfedd.xml) to retrieve a RSS feed.
on http://sfdmorin.com/accueil/index.php everything works fine, on http://danielpoiriergda.ca/accueil/index.php i get:
Warning: fopen(http://affaires.lapresse.ca/rss/2399.xml)
[function.fopen]: failed to open stream: Permission denied in
/var/www/vhosts/danielpoiriergda.ca/httpdocs/snippet/lastRSS.php on
line 143
$f = fopen("http://affaires.lapresse.ca/rss/2399.xml", 'r');
Both website have php debug mode enabled and both have the same permissions for file and folders.
Both info.php have *allow_url_fopen* enabled for local and master value
Here are the major differences I found on both phpinfo() file:
not working site: Server API CGI/FastCGI
working site: Server API Apache 2.0 Handler
and on the working site there are no php.ini file in the path given by the loaded configuration file field
EDIT:
I know this thread is probably dead, but not the problem.
I check, with Netbeans fill diff, all the PHP code and php.ini are exactly the same on both domain.
I know similar questions were ask, but they did not help me.
Thank you!
Finally, I contacted my webserver tech support and they solve the problem. They did by:
adding an exception to SELinux
I dont have a clue wwhat SELinux is or what they did specificaly.
I am currently using an image manipulation script to do some work on uploaded images and I'm running into a problem in my dev environment. This same code works on my production server.
The error is:
PHP Warning: imagecreatefromjpeg(): php_network_getaddresses:
getaddrinfo failed: Name or service not known in /path/to/script.php
on line 75
The line of code on 75 is:
$this->img = imagecreatefromjpeg(PHPTHUMB."?src=/".$this->image_path);
which creates an image that is loaded from another made by phpThumb, which is used for further manipulation.
Any ideas on how to solve this? Can anyone shed some light on what the error means?
Thank you,
Edit:
Just as a further bit of insight, if i visit PHPTHUMB . "?src=/" . $this->image_path in my browser, the image loads fine
User agent in php.ini did not solve the problem as indicated here
EDIT (SOLUTION): I had to add the INTERNAL 192.168.204.XXX IP into the hosts file, so that http://dev.mysite.com resolved correctly. Trying both 127.0.0.1 and the external IP yielded no result, but the internal works perfectly. Thanks for everyone's efforts,
I'm totally not sure about the cause of that error, but this is my best guess.
There is a particular PHP Setting which enables you to treat URLs as files. Normally imagecreatefromjpeg accepts a filename, I think. Since you are passing a URL, you need to make sure the particular setting is enabled. I believe you can find more info about it here: http://us2.php.net/file
filename
Path to the file.
Tip
A URL can be used as a filename with this function if the fopen
wrappers have been enabled. See
fopen() for more details on how to
specify the filename and List of
Supported Protocols/Wrappers for a
list of supported URL protocols.
Fopen wrappers: http://us2.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen
Your dev environment may not be setup with this, but your production environment could be.
Edit
This page lists your error:
http://bugs.php.net/bug.php?id=11058
and mentions that a possible fix is by modifying your hosts file to explicitly include the ip/dns of the server you're accessing.
i tryed to reconfigure my named
configuration, without any result, to
fix this. the problem was solved by
adding the following line to my
/etc/hosts:
194.97.55.147 mx.freenet.de
Maybe you can try this?
did you also check that allow_url_fopen is set to On in php.ini?
I saw that they did mention that in the article you referred to in your post.
EDIT: Also, what OS and what PHP version are you running?
Just read this on php.net: "On Windows versions prior to PHP 4.3.0, the following functions do not support remote file accessing: include(), include_once(), require(), require_once() and the imagecreatefromXXX functions in the GD Functions extension."
EDIT2:
I just read what was written in the comments, your allow_url_fopen is set to On, sorry about that.
But OS, PHP version and phpinfo() would help in finding the problem.
The error message suggests something is wrong at a networking level. Thus, if possible, bypass that. Try using the path to the thumbnail generator, instead of a network address.
If that's not an option, try something that will give you more granular error messages. I suggest CURL. At the very least, it should yield a more informative error message.
The simple fact that this is failing is because on your webserver, your DNS resolution is broken.
If you have SSH access to your server, try the following command
dig hostname
where hostname is the host name from PHPTHUMB
This will probably fail.
Assuming that you're using Linux, my suggestion would be to edit your /etc/resolv.conf (as root)
and add the following line before any other lines beginning with "nameserver"
nameserver 4.2.2.2
This should hopefully fix things, though you may have to restart apache (or whatever webserver you're using)!
The issue here is that php fails to resolve the url that you provide as PHPTHUMB as stated in this bug report on php.net. This possibly means that it's the fault of the operating system/web server, in which case you can enter the ip address of the server you are connecting to into your hosts file manually.