Topic: Problems installing attachments mod

I am a new user and am trying to install the attachments mod. Unfortunately, the link to the installation instructions in the mod's release thread no longer works.

I have uploaded the AP_Attachment_Mod.php file to the plugins folder on the server and the attachment mod is showing up in the admin control panel. However, when I click on this I get the following:

Warning: require(./include/attach/attach_incl.php) [function.require]: failed to open stream: No such file or directory in /home/rosebar/public_html/forum/plugins/AP_Attachment_Mod.php on line 48

Warning: require(./include/attach/attach_incl.php) [function.require]: failed to open stream: No such file or directory in /home/rosebar/public_html/forum/plugins/AP_Attachment_Mod.php on line 48

Fatal error: require() [function.require]: Failed opening required './include/attach/attach_incl.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/rosebar/public_html/forum/plugins/AP_Attachment_Mod.php on line 48

Please could someone tell me what I have done wrong and what I need to do to get the mod to work properly.

Re: Problems installing attachments mod

you need to check that /include/attach/attach_incl.php is there. They need to be in that folder with the exact names, Case sensitive.

Sorry. Unactive due to personal life.

3 (edited by rosebar 2008-10-02 16:08)

Re: Problems installing attachments mod

There is no file called include/attach/attach_inc.php in the punbb upload folder. Can I make this myself and what should it contain? Otherwise where can I find it?

On further inspection I see that this file is mentioned in the attachment mod file that I have uploaded to the plugins folder. Is admin_loader.php supposed to create the include/attach/attach_inc.php file when the attachment mod is installed?

Re: Problems installing attachments mod

audio.png to img/attach/
compressed.pnd to img/attach/
image.png to img/attach/
index.html to img/attach/
text.png to img/attach/
unknown.png to img/attach/
video.png to img/attach/

attach_incl.php to include/attach/
attach_func.php to include/attach/

attach.php to lang/English/

AP_Attachment_Mod.php to plugins/

attachment.php to /
install_mod.php to /
install_mod_updater.php to /

index.htm to attachment-directory  (read the preparations above!)
.htaccess to attachment-directory

Sorry. Unactive due to personal life.

Re: Problems installing attachments mod

Thanks for your help but I'm really confused. I have no knowledge of php which might explain why I don't understand your post but are you saying that everything in your post should be copied and added to a newly created attach_incl.php file or that all the files listed (or just the files in bold?) need to be created and added to the folders mentioned. If so are these all empty files?

I have tried the former and that doesn't work so I can only assume that I have to create all the files listed and upload them to the places mentioned. Not sure what I have to do with the pngs listed at the beginning?

Would you mind giving me a little more explanation? Thanks in advance!

Re: Problems installing attachments mod

that is the file locations. So you should have forum/include/attach/attach_incl.php

Sorry. Unactive due to personal life.

Re: Problems installing attachments mod

Yes I now have forum/include/attach/attach_inc.php (the attach.inc.php file being an empty file - is that right?). I also have forum/include/attach/attach_func.php. However, the mod still doesn't work - same error messages as before.

Re: Problems installing attachments mod

You get both of them files from the download. Both are included in the attachment mod.

Sorry. Unactive due to personal life.

Re: Problems installing attachments mod

That's the answer I was looking for! It turns out that for some unknown reason the only thing in my original downloaded was the attachment_mod.php file. This is why none of this made any sense. I've literally wasted hours trying to work out what I was supposed to do. I've just downloaded the mod again and you are right there are loads of files there and a readme. I'll take a good look at this and hopefully everything will now fall into place. Thanks for your help - hopefully I'll be OK now.

10

Re: Problems installing attachments mod

You proberbly download the hdiff version or upgrade version.

Sorry. Unactive due to personal life.

11 (edited by rosebar 2008-10-03 15:56)

Re: Problems installing attachments mod

I have followed all the instructions, edited and uploaded all the files (this took ages), run the installer etc. Everything looks great and there is now a button at the bottom of new posts so that attachments can be chosen and added to posts before posting. However, the attachment is nowhere to be seen once the post has been submitted.

I created my new attachments folder in a non-public part of the server and uploaded index.html to it as instructed. However, I'm not convinced I installed the .htaccess file correctly. Could this be the problem? if so, any tips on creating an .htaccess file would be appreciated as my computer hides all files starting with a . making it virtually impossible to find and upload them!

Edit: I think I have now sorted out my .htaccess file problem but this has made no difference, attachments still don't attach themselves to posts or appear in the new attachments folder.

Edit2: On reflection I am still not convinced my .htaccess file is correct. Is this file supposed to be included in the mod's download folder?

I have re-read the instructions and tried to upload a very small test file. This has resulted in the following error message:

"An error was encountered
Error: Unable to move file from: /tmp/php6UOwaC to /home/rosebar/attachments/109bb1f4d3a7c9182e9db4f3e1e0d393/e49808f026f0b0e3d06dddc664d05601.attach."

So there seems to be a problem actually moving the file to the attachments folder which makes me wonder whether this is connected to the .htaccess problem. If anyone can shed any light on the necessary .htaccess file that needs to be uploaded to the attachments folder that would be appreciated as I feel I am close to sorting this out and it would be a pity to give up now. smile

Re: Problems installing attachments mod

Just bumping this thread and clarifying my outstanding questions:

1. Why am I receiving the following error message when trying to post attachments using the attachments mod?

"An error was encountered
Error: Unable to move file from: /tmp/php6UOwaC to /home/rosebar/attachments/109bb1f4d3a7c9182e9db4f3e1e0d393/e49808f026f0b0e3d06dddc664d05601.attach."

2. What/where is the .htaccess file referred to in the instructions that needs to be placed in my newly created attachments folder? Is the fact that this is missing the reason for the error message above?

Surely someone here has managed to install this mod and is therefore able to help?

13

Re: Problems installing attachments mod

enable debug mode and paste the full error message (search the forums if you dont know how to enable that)

Does that folder have the right premessions??

And if you download the file agen your see the .htaccess and the readme will tell you where it goes

Sorry. Unactive due to personal life.

Re: Problems installing attachments mod

After enabling debug mode the error message is:

"File: /home/rosebar/public_html/forum/include/attach/attach_func.php
Line: 107

PunBB reported: Unable to move file from: /tmp/phpWUgyeO to /home/rosebar/attachments/109bb1f4d3a7c9182e9db4f3e1e0d393/541afe8df4f39bb9eab4a48ee7b96416.attach"

Interestingly this message only seems to come up with an rtf file. If I try to attach a pdf or jpg I don't get an error message but the new post doesn't show the attachments so it isn't working with these either.

The attachments folder's permissions are 777. I have just changed the include/attach/attach.func.php to 777 too but that has made no difference.

I have downloaded the attachments folder again (for the third time actually as I'd already thought of this) and this time there is a .htaccess file there. Weird. Anyway, uploading this has made no difference to the error message.

Thanks for persevering!

Re: Problems installing attachments mod

rosebar, what is your hoster? Some free hostings has odd limitations.
Perhabs the source file in tmp folder was absent? Try to check it.

DigitalOcean: VPS from $5/mon. Get $10 bonus!.

Re: Problems installing attachments mod

Hi, I' m using fully featured hosting with PHP 5 - it's not free.

The only tmp folder I can find is in the home folder and that only appears to contain my site stats.

I do have a strange php.ini file in my public folder, placed there by my hosting provider when I was having some problems with my site a few weeks ago but I can't imagine that is the problem.

17 (edited by artoodetoo 2008-10-07 13:37)

Re: Problems installing attachments mod

rosebar wrote:

Interestingly this message only seems to come up with an rtf file. If I try to attach a pdf or jpg I don't get an error message but the new post doesn't show the attachments so it isn't working with these either.

It may sounds boring, but check your "Max filesize" setting for attachment mod, please. Try to upload tiny files.
A.f.a.i.k. too big files doesn't attached without any error messages.

DigitalOcean: VPS from $5/mon. Get $10 bonus!.

18 (edited by rosebar 2008-10-07 15:00)

Re: Problems installing attachments mod

Max filesize is 10,000 bytes - I think it was originally 2,000 bytes and I increased it in the alter settings panel. However, the txt file I am trying to attach is only 4 kb. I read in the instructions that I should test with a very small file so I made this one specially.

I've just re-read the documentation and found this: 

"The most important PHP setting is called "upload_max_filesize" and is default "2M". This value can either be per directory or per system. While you're in the php.ini file, make sure "file_uploads" is "1".
To further complicate things, there's two more things in the php.ini file that needs consideration (and that may not be per folder, so it's global). The settings "post_max_size" must be greater than "upload_max_filesize", and "memory_limit" should be larger than "post_max_size". So it's not just to up one value to handle large files."

How do I check this? There is no php.ini file in the mod's folder and the only one uploaded to the server was put there by my host.

Re: Problems installing attachments mod

You can check (but not change) current PHP settings in PunBB Administration panel / Index / "Show info" link.

DigitalOcean: VPS from $5/mon. Get $10 bonus!.

Re: Problems installing attachments mod

The upload_max_file size is 16M and the post_max_size is 8M. Clearly post_max_size is not greater than upload_max_size so could this be the problem?

Memory limit is 32M so that is OK. File_uploads is "on" not "1".