require_once() Fatal Error: File Exists

I’m not sure what exactly went wrong, but at some point I broke my roundcube installation. Now, when I try to access roundcube I get PHP Fatal error: require_once(): Failed opening required ‘program/include/iniset.php’ (include_path=’.:/usr/share/pear:/usr/share/php’) in /srv/www/roundcube/index.php on line 31

The file /usr/share/roundcubemail/program/include/iniset.php exists. Changing permissions does not seem to help. I also tried modifying index.php with the following

I’ve tried modifying the line a number of ways

[ul][li]require_once ‘program/include/iniset.php’;[/li]
[li]require_once(DIR . “/program/include/iniset.php”);[/li]
[li]require_once("/srv/www/roundcube/program/include/iniset.php");[/li]
[li]require_once ‘./program/include/iniset.php’;[/li]
[li]require_once ‘/program/include/iniset.php’;[/li][/ul]

With any of these versions I get an error.

When I call phpinfo() from within index.php I get"open_basedir => no value => no value" when called from the command line…

This site is configured to run within an apache virtualhost with the following settings:

<VirtualHost *:443>
ServerAdmin [email protected]
ServerName webmail.mydomain.com
DocumentRoot /srv/www/roundcube/
ErrorLog /srv/www/mydomain.com/logs/webmail-error.log
CustomLog /srv/www/mydomain.com/logs/webmail-access.log common
SSLEngine on
SSLCertificateFile /etc/httpd/certificate.pem
SSLCertificateKeyFile /etc/httpd/privkey.pem

RewriteBase /
SSLRequire %{SSL_CIPHER_USEKEYSIZE} >= 128

<Directory /srv/www/roundcube/>
Options +FollowSymLinks Indexes
AllowOverride All
order allow,deny
allow from all

Options Includes FollowSymLinks

<VirtualHost *:80>
ServerAdmin [email protected]
ServerName webmail.mydomain.com
Redirect permanent / https://webmail.mydomain.com

Running php 5.3.3
Zend Engine 2.3

You said /usr/share/roundcubemail/program/include/iniset.php exists but I don’t see where you tried to require that path?

What is the path to index.php?

Sorry, I mistyped. It should read /srv/www/roundcube/ exists. Also that is where index.php is located. I had previously had everything under /usr/share/roundcube/.

That is pretty odd that it doesn’t work with the full path. Makes me think there is a permissions problem or the path is invalid.

Try this:

[php]require_once(dirname(FILE) . ‘/program/include/iniset.php’);[/php]

Tried the [php]require_once(dirname(FILE) . ‘/program/include/iniset.php’);[/php] line and still the same error occurs…

I tried chmodding the include directory to 777 and that doesn’t help. How could the path be invalid? Any other ideas on what to try?

I’m not sure what the problem could be. Maybe in your index.php paste this at the top and post the output here (remove any personal information)

[php]
echo “

”;
print_r($_SERVER);
echo “
”;
exit;
[/php]

Here is the output:

( [HTTPS] => on [SSL_TLS_SNI] => webmail.mydomain.com [HTTP_HOST] => webmail.mydomain.com [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20100101 Firefox/16.0 [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 [HTTP_ACCEPT_LANGUAGE] => en-US,en;q=0.5 [HTTP_ACCEPT_ENCODING] => gzip, deflate [HTTP_CONNECTION] => keep-alive [HTTP_COOKIE] => SESScffa61ba61d02dd1118055ad087096cb=6Q_hKA6XYLQ_5DUZbnQwNBdOMBFzjMRWeEdV19cVPMM; SESS9ad974426b7ff8767fd7d2f411b05c35=b1s6mov3vrmngd3i37p4jnjj30 [PATH] => /sbin:/usr/sbin:/bin:/usr/bin [SERVER_SIGNATURE] => [SERVER_SOFTWARE] => Apache/2.2.15 (CentOS) [SERVER_NAME] => webmail.mydomain.com [SERVER_ADDR] => XX.XX.XX.XX [SERVER_PORT] => 443 [REMOTE_ADDR] => XX.XX.XX.XX [DOCUMENT_ROOT] => /srv/www/roundcube/ [SERVER_ADMIN] => [email protected] [SCRIPT_FILENAME] => /srv/www/roundcube/index.php [REMOTE_PORT] => 49985 [GATEWAY_INTERFACE] => CGI/1.1 [SERVER_PROTOCOL] => HTTP/1.1 [REQUEST_METHOD] => GET [QUERY_STRING] => [REQUEST_URI] => / [SCRIPT_NAME] => /index.php [PHP_SELF] => /index.php [REQUEST_TIME] => 1351885251 )

Thank you M@tt for all the tremendous help so far.

I am really stumped on this one. Let’s see if PHP can find the file? In index.php again:

[php]
echo "iniset.php " . (file_exists(’/srv/www/roundcube/program/include/iniset.php’) ? “exists” : “does not exist”);
exit;
[/php]

Interesting:

That code gives me “iniset.php does not exist”

I assume you have ssh access? What happens when you stat the file?

stat /srv/www/roundcube/program/include/iniset.php

You are going to have to figure out why the file is not found. Either some kind of corruption, permissions, maybe even has a typo in the name? I don’t know. Good luck :slight_smile:

stat gives me:

  File: `/srv/www/roundcube/program/include/iniset.php'
  Size: 4363      	Blocks: 16         IO Block: 4096   regular file
Device: 3ah/58d	Inode: 20909500    Links: 1
Access: (0777/-rwxrwxrwx)  Uid: (   48/  apache)   Gid: (   48/  apache)
Access: 2012-11-02 00:00:45.000000000 -0400
Modify: 2012-08-20 11:00:34.000000000 -0400
Change: 2012-11-02 15:28:32.000000000 -0400

With permissions at 777 I’m not sure how it could be a permissions issue. It’s not a typo…which I guess just leaves corruption, but if I open it in vim, why would php not be able to open it?

If you stat /srv/www/roundcube/index.php does it have the same user/group?

Uid: ( 48/ apache) Gid: ( 48/ apache)

Yeah, stat index.php gives me:

File: `index.php' Size: 11463 Blocks: 24 IO Block: 4096 regular file Device: 3ah/58d Inode: 20910037 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 48/ apache) Gid: ( 48/ apache) Access: 2012-11-02 16:16:32.000000000 -0400 Modify: 2012-11-02 16:16:15.000000000 -0400 Change: 2012-11-02 16:16:16.000000000 -0400

Unfortunately I’m all out of ideas.

Could it be something in the apache config, or php.ini?

The only thing I can think of is maybe if safe mode is on. I don’t know if that could cause a problem or not.

You can see in phpinfo() if it is on just look for ‘safe_mode’

safe_mode is off.

I ran some code to show me the files in the directory:
[php]$directory = “/srv/www/roundcube/program/”;

$files1 = scandir($directory);
print_r($files1);[/php]

When I run it with “/srv/www/roundcube/” everything is there as expected. Same goes for “/srv/www/roundcube/program/”. For “/srv/www/roundcube/program/include/” I get nothing…

Can you paste the directories here

ls -lh /srv/www/roundcube/program/

and

ls -lh /srv/www/roundcube/program/include/

ls -lh /srv/www/roundcube/program/

total 28K -rw-r--r-- 1 apache apache 56 Aug 15 12:44 blank.gif -rw-r--r-- 1 apache apache 118 Aug 15 12:44 blocked.gif drw-r--r-- 2 apache apache 4.0K Nov 2 16:34 include drw-r--r-- 3 apache apache 4.0K Sep 15 02:48 js drw-r--r-- 2 apache apache 4.0K Sep 15 02:48 lib drw-r--r-- 71 apache apache 4.0K Sep 15 02:48 localization drw-r--r-- 6 apache apache 4.0K Sep 15 02:48 steps

ls -lh /srv/www/roundcube/program/include/

total 944K -rwxr--r-- 1 apache apache 2.8K Aug 15 12:44 clisetup.php -rwxr--r-- 1 apache apache 21K Aug 15 12:44 html.php -rwxr--r-- 1 apache apache 4.3K Nov 2 16:34 iniset.php -rwxr--r-- 1 apache apache 4.3K Nov 2 16:34 iniset.php.new -rwxr--r-- 1 apache apache 4.3K Aug 20 11:00 iniset.php.orig -rwxr--r-- 1 apache apache 68K Aug 20 11:00 main.inc -rwxr--r-- 1 apache apache 50K Aug 15 12:46 rcmail.php -rwxr--r-- 1 apache apache 17K Aug 15 12:44 rcube_addressbook.php -rwxr--r-- 1 apache apache 3.3K Aug 15 12:44 rcube_browser.php -rwxr--r-- 1 apache apache 16K Aug 15 12:44 rcube_cache.php -rwxr--r-- 1 apache apache 11K Aug 15 12:44 rcube_config.php -rwxr--r-- 1 apache apache 33K Aug 15 12:44 rcube_contacts.php -rwxr--r-- 1 apache apache 1.8K Aug 15 12:44 rcube_content_filter.php -rwxr--r-- 1 apache apache 9.3K Aug 15 12:44 rcube_html_page.php -rwxr--r-- 1 apache apache 40K Aug 15 12:44 rcube_imap_cache.php -rwxr--r-- 1 apache apache 112K Aug 15 12:44 rcube_imap_generic.php -rwxr--r-- 1 apache apache 151K Aug 15 12:44 rcube_imap.php -rwxr--r-- 1 apache apache 7.3K Aug 15 12:44 rcube_json_output.php -rwxr--r-- 1 apache apache 68K Aug 15 12:44 rcube_ldap.php -rwxr--r-- 1 apache apache 23K Aug 15 12:44 rcube_mdb2.php -rwxr--r-- 1 apache apache 29K Aug 15 12:44 rcube_message.php -rwxr--r-- 1 apache apache 14K Aug 15 12:44 rcube_plugin_api.php -rwxr--r-- 1 apache apache 8.5K Aug 15 12:44 rcube_plugin.php -rwxr--r-- 1 apache apache 1.8K Aug 15 12:44 rcube_result_set.php -rwxr--r-- 1 apache apache 16K Aug 15 12:44 rcube_session.php -rwxr--r-- 1 apache apache 16K Aug 15 12:44 rcube_shared.inc -rwxr--r-- 1 apache apache 15K Aug 15 12:44 rcube_smtp.php -rwxr--r-- 1 apache apache 18K Aug 15 12:44 rcube_spellchecker.php -rwxr--r-- 1 apache apache 2.1K Aug 15 12:44 rcube_sqlite.inc -rwxr--r-- 1 apache apache 5.2K Aug 15 12:44 rcube_string_replacer.php -rwxr--r-- 1 apache apache 47K Aug 15 12:44 rcube_template.php -rwxr--r-- 1 apache apache 21K Aug 15 12:44 rcube_user.php -rwxr--r-- 1 apache apache 26K Aug 15 12:44 rcube_vcard.php

and for good measure:
ls -lh /srv/www/roundcube/

total 96K drw-r--r-- 2 apache apache 4.0K Nov 1 13:14 bin -rw-r--r-- 1 apache apache 58K Nov 2 15:29 debugtxt -rw-r--r-- 1 apache apache 12K Nov 2 17:30 index.php drw-r--r-- 29 apache apache 4.0K Sep 15 02:48 plugins drw-r--r-- 7 apache apache 4.0K Nov 2 17:14 program -rw-r--r-- 1 apache apache 26 Aug 15 12:44 robots.txt drw-r--r-- 3 apache apache 4.0K Sep 15 02:48 skins

I have absolutely no idea what the problem is. Maybe you can find a forum with system admins because I don’t think this has anything to do with PHP. Good luck

Sponsor our Newsletter | Privacy Policy | Terms of Service