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.
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.
I'm just beginning with Symfony 3 but I'm stuck with a built-in server issue.
I am using wamp64 v3.0.6 with PHP 7.1.9 (and PHPStorm as IDE) on Windows 7.
I ran the built-in server once and got a response from localhost:8000 correctly but then, just like [this issue][1], I get the following error message when I try to access localhost:8000 on subsequent tries :
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required'C:\wamp64\www\projectname\vendor\symfony\symfony\src\Symfony\Bundle\WebServerBundle/Resources/router.php' (include_path='.;C:\php\pear') in Unknown on line 0
I've tried uninstalling symfony, wamp64 and PHPstorm to try to identify the problem.
After reinstalling wamp (without running the server) and symfony I've noticed the following :
When I run the built-in server for the first time and immediately access localhost:8000, it works fine. But then the server stops without my pressing CTRL-C. When I restart the server and try to access localhost:8000 I now get said error message.
I've tried creating a another project using PHP 7.0.23 with the same results : once the server crashes, I can no longer load my project.
I'm hoping someone can provide an answer as regarding this issue. I've spent the past few hours searching the web for an answer and have found none.
Thanks in advance.
Credit goes to Baig for this answer :
The source of the issue lies with the antivirus. To solve this, I've excluded the wamp directory (where symfony and my projects are also stored) from my antivirus and, voila, no more server crashes, everything works fine.
I'm running a CentOS 7 server with Virtualmin/Webmin and virtual hosts configured. I want to send all emails addressed to one specific email address hosted on this system (belonging to one virtual host) to a PHP script for processing. From research, I assume procmail is the simplest way to do this. I assume I need to create a .procmailrc file in the user's home directory.
However, this .procmailrc file does not get executed. I found instructions for enabling local .procmailrc files:
Go to Virutalmin -> Email Messages -> Spam and Virus Scanning and turn on "Allow mailbox users to create mail filters"
However, I can't get this to work. Every time I try to save the change, I get this error:
LibClamAV Warning: **************************************************
LibClamAV Warning: *** The virus database is older than 7 days! ***
LibClamAV Warning: *** Please update it as soon as possible. ***
LibClamAV Warning: **************************************************
ERROR: Can't write to temporary directory
I don't know what directory it's trying to write, and second, if I try to update clamav ("yum update clamav") I get a message: "no packages marked for update".
UPDATE: after rebooting the server, I am able to save the setting. However, it still doesn't appear that the local .procmailrc file is being executed.
Here's the .procmailrc file:
DEFAULT=$HOME/Maildir/
MAILDIR=$HOME/Maildir
PMDIR=$HOME/.procmail
LOGFILE=$PMDIR/log.`date +%y-%m-%d`
SHELL=/bin/sh
:0
| /usr/bin/php /home/user/homes/support/mailhandler.php
The mailhandler.php file is owned by 'user' and has 744 permissions. It simply dumps the STDIN data into a log file in the same directory, with 666 permissions.
First question: is using procmail the simplest way to achieve this? If not, what is?
Second question: how can I get local .procmailrc scripts to work?
Thanks!
Hello I have simple php script well it is more a html file with few php lines.
Yet it produces tons of errors in log that look like this on every line:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20100525/suhosin.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20100525/suhosin.so: cannot open shared object file: No such file or directory in Unknown on line 0
I can not locate in nowhere in code where suhosin might been called...
This error is present on 2 different servers.
EDIT:
In phpinfo there is no suhosin present...
Thanks.
We will likely need more information in order to provide an accurate resolution, such as What version of PHP is installed on your system? however I will give you a general resolution.
Generally this issue is caused by PHP Upgrade, most recent PHP versions does not support suhosin as this only applied to older versions of php that needed additional security.
If you are on a shared hosting server you need to contact to your hosting provider and notify them about this issue, they are likely able to resolve it quickly.
If you are on a Dedicated server, VPS server or a localhost environment you can solve this issue by following the steps below:
Find your php.ini location [You can use phpinfo() to locate php.ini file]
Open the php.ini file and search suhosin.so
When you find suhosin comment this line extension = "suhosin.so" by adding semicolon at the beginning of the line, For example: ;extension = "suhosin.so"
Save this file
Restart Apache service httpd restart
Note: If ClouldLinux installed on your server, you need to force update CageFS by issuing the following command at the command line cagefsctl --force-update
I want to read a XML file from a certain link with the following code
$filename = 'http://XXXXX/rss.xml';
$xml = simplexml_load_file($filename);
When I try, I get the following error messages:
wrapper is disabled in the server configuration by allow_url_fopen=0
failed to open stream: no suitable wrapper could be found in
I/O warning : failed to load external entity
Whats the problem? Can it be that the server doesn´t support simplexml_load_file?
When allow_url_fopen is set to 0, you have no permissions to acces URL objects like files. Read official manual for more information.
You can not change this value via .htaccess, so you have to set allow_url_fopen=1 in your php.ini file. If you're using a shared hosting or some kind of it, you should contact hosting technical support and describe them your problem.