Attaching Files in phpMyFAQ 2.0.7
Moderator: Thorsten
Attaching Files in phpMyFAQ 2.0.7
Hi,
I have a problem when I try ti attach files when editing the FAQ content.
I get the Browse/Upload window and after selecting the file to upload I get the following message:
Add an attachment to the issue
An error occurred while attaching the file.
Close this window
I did check the file permission of the phpMYFAQ directory, the attachment directory and the attachment.php file ( I set them all to 777 to test) - but still get the same error.
Can you advise on what other steps to take?
Thank you.
Graham
I have a problem when I try ti attach files when editing the FAQ content.
I get the Browse/Upload window and after selecting the file to upload I get the following message:
Add an attachment to the issue
An error occurred while attaching the file.
Close this window
I did check the file permission of the phpMYFAQ directory, the attachment directory and the attachment.php file ( I set them all to 777 to test) - but still get the same error.
Can you advise on what other steps to take?
Thank you.
Graham
Re: Attaching Files in phpMyFAQ 2.0.7
Hi,
please enable the debug mode in inc/Init.php and set the mode to "true". Then try it again and look at possible error messages.
Thanks!
bye
Thorsten
please enable the debug mode in inc/Init.php and set the mode to "true". Then try it again and look at possible error messages.
Thanks!
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Re: Attaching Files in phpMyFAQ 2.0.7
HI,
Here is what is displayed with the debug set to true after I click Upload to upload the attachment.
Can you help me understand what this is telling me?
Thanks
Graham
Notice: Constant PMF_ROOT_DIR already defined in /opt/coolstack/apache2/htdocs/pmwiki/faq/gscwiki/admin/attachment.php on line 30
Warning: session_regenerate_id() [function.session-regenerate-id]: Cannot regenerate session id - headers already sent in /opt/coolstack/apache2/htdocs/pmwiki/faq/gscwiki/inc/PMF_User/CurrentUser.php on line 300
Add an attachment to the issue
An error occurred while attaching the file.
Close this window
PMF_Configuration->getAll() in line 87:
SELECT
config_name, config_value
FROM
faqconfig
PMF_User->getUserById() in line 416:
SELECT
user_id,
login,
account_status
FROM
faquser
WHERE
user_id = 1
PMF_User->getUserById() in line 416:
SELECT
pass
FROM
faquserlogin
WHERE
login = 'admin'
PMF_UserData->load() in line 331:
SELECT
last_modified, display_name, email
FROM
faquserdata
WHERE
user_id = 1
PMF_CurrentUser->getSessionInfo() in line 423:
SELECT
session_id,
session_timestamp,
ip
FROM
faquser
WHERE
user_id = 1
PMF_CurrentUser->updateSessionId() in line 434:
UPDATE
faquser
SET
session_id = 'b6a8cbb87bd1529ac913e46
Here is what is displayed with the debug set to true after I click Upload to upload the attachment.
Can you help me understand what this is telling me?
Thanks
Graham
Notice: Constant PMF_ROOT_DIR already defined in /opt/coolstack/apache2/htdocs/pmwiki/faq/gscwiki/admin/attachment.php on line 30
Warning: session_regenerate_id() [function.session-regenerate-id]: Cannot regenerate session id - headers already sent in /opt/coolstack/apache2/htdocs/pmwiki/faq/gscwiki/inc/PMF_User/CurrentUser.php on line 300
Add an attachment to the issue
An error occurred while attaching the file.
Close this window
PMF_Configuration->getAll() in line 87:
SELECT
config_name, config_value
FROM
faqconfig
PMF_User->getUserById() in line 416:
SELECT
user_id,
login,
account_status
FROM
faquser
WHERE
user_id = 1
PMF_User->getUserById() in line 416:
SELECT
pass
FROM
faquserlogin
WHERE
login = 'admin'
PMF_UserData->load() in line 331:
SELECT
last_modified, display_name, email
FROM
faquserdata
WHERE
user_id = 1
PMF_CurrentUser->getSessionInfo() in line 423:
SELECT
session_id,
session_timestamp,
ip
FROM
faquser
WHERE
user_id = 1
PMF_CurrentUser->updateSessionId() in line 434:
UPDATE
faquser
SET
session_id = 'b6a8cbb87bd1529ac913e46
Re: Attaching Files in phpMyFAQ 2.0.7
Hi,
please remove line 30 in admin/attachement.php and try it again. Thanks!
bye
Thorsten
please remove line 30 in admin/attachement.php and try it again. Thanks!
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Re: Attaching Files in phpMyFAQ 2.0.7
Hi,
I commented out line 30 .. but still have the same issue.
Here is the error message this time:
Add an attachment to the issue
An error occurred while attaching the file.
Close this window
PMF_Configuration->getAll() in line 87:
SELECT
config_name, config_value
FROM
faqconfig
PMF_User->getUserById() in line 416:
SELECT
user_id,
login,
account_status
FROM
faquser
WHERE
user_id = 1
PMF_User->getUserById() in line 416:
SELECT
pass
FROM
faquserlogin
WHERE
login = 'admin'
PMF_UserData->load() in line 331:
SELECT
last_modified, display_name, email
FROM
faquserdata
WHERE
user_id = 1
PMF_CurrentUser->getSessionInfo() in line 423:
SELECT
session_id,
session_timestamp,
ip
FROM
faquser
WHERE
user_id = 1
PMF_PermBasic->getAllRightsData() in line 77:
SELECT
right_id,
name,
description,
for_users,
for_groups
FROM
faqright
ORDER BY
right_id ASC
PMF_PermBasic->getUserRights() in line 309:
SELECT
faqright.right_id AS right_id
FROM
faqright,
faquser_right,
faquser
WHERE
faqright.right_id = faquser_right.right_id AND
faquser.user_id = 1 AND
faquser.user_id = faquser_right.user_id
I commented out line 30 .. but still have the same issue.
Here is the error message this time:
Add an attachment to the issue
An error occurred while attaching the file.
Close this window
PMF_Configuration->getAll() in line 87:
SELECT
config_name, config_value
FROM
faqconfig
PMF_User->getUserById() in line 416:
SELECT
user_id,
login,
account_status
FROM
faquser
WHERE
user_id = 1
PMF_User->getUserById() in line 416:
SELECT
pass
FROM
faquserlogin
WHERE
login = 'admin'
PMF_UserData->load() in line 331:
SELECT
last_modified, display_name, email
FROM
faquserdata
WHERE
user_id = 1
PMF_CurrentUser->getSessionInfo() in line 423:
SELECT
session_id,
session_timestamp,
ip
FROM
faquser
WHERE
user_id = 1
PMF_PermBasic->getAllRightsData() in line 77:
SELECT
right_id,
name,
description,
for_users,
for_groups
FROM
faqright
ORDER BY
right_id ASC
PMF_PermBasic->getUserRights() in line 309:
SELECT
faqright.right_id AS right_id
FROM
faqright,
faquser_right,
faquser
WHERE
faqright.right_id = faquser_right.right_id AND
faquser.user_id = 1 AND
faquser.user_id = faquser_right.user_id
Re: Attaching Files in phpMyFAQ 2.0.7
Hi,
please take a look at line 141 for this code
and change it to
Thanks.
bye
Thorsten
please take a look at line 141 for this code
Code: Select all
if (@move_uploaded_file($_FILES["userfile"]["tmp_name"], PMF_ROOT_DIR."/attachments/".$_REQUEST["id"]."/".$_FILES["userfile"]["name"])) {
Code: Select all
if (move_uploaded_file($_FILES["userfile"]["tmp_name"], PMF_ROOT_DIR."/attachments/".$_REQUEST["id"]."/".$_FILES["userfile"]["name"])) {
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Re: Attaching Files in phpMyFAQ 2.0.7
Hi,
In removing and replacing the line suggested I now get this error message:
Add an attachment to the issue
Warning: move_uploaded_file() [function.move-uploaded-file]: SAFE MODE Restriction in effect. The script whose uid is 0 is not allowed to access /opt/coolstack/apache2/htdocs/pmwiki/faq/gscwiki/attachments/71 owned by uid 80 in /opt/coolstack/apache2/htdocs/pmwiki/faq/gscwiki/admin/attachment.php on line 144
An error occurred while attaching the file.
Thanks
Graham
In removing and replacing the line suggested I now get this error message:
Add an attachment to the issue
Warning: move_uploaded_file() [function.move-uploaded-file]: SAFE MODE Restriction in effect. The script whose uid is 0 is not allowed to access /opt/coolstack/apache2/htdocs/pmwiki/faq/gscwiki/attachments/71 owned by uid 80 in /opt/coolstack/apache2/htdocs/pmwiki/faq/gscwiki/admin/attachment.php on line 144
An error occurred while attaching the file.
Thanks
Graham
Re: Attaching Files in phpMyFAQ 2.0.7
Hi,
you have to disable your safe mode in PHP.
bye
Thorsten
you have to disable your safe mode in PHP.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Re: Attaching Files in phpMyFAQ 2.0.7
Hi,
Thanks for the tip. I don't want to disable Safe Mode - as the PHP instance I have uses it for other applications.
I assume then that the attachments part won't work - unless there is a workaround.
Regards
Graham
Thanks for the tip. I don't want to disable Safe Mode - as the PHP instance I have uses it for other applications.
I assume then that the attachments part won't work - unless there is a workaround.
Regards
Graham
Re: Attaching Files in phpMyFAQ 2.0.7
Hi,
please wait... who's the owner of the script admin/attachment.php?
bye
Thorsten
please wait... who's the owner of the script admin/attachment.php?
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Re: Attaching Files in phpMyFAQ 2.0.7
Hi,
It's root - as per ....
-rwxrwxrwx 1 root root 8296 Mar 25 11:05 attachment.php
Regards
Graham
It's root - as per ....
-rwxrwxrwx 1 root root 8296 Mar 25 11:05 attachment.php
Regards
Graham
Re: Attaching Files in phpMyFAQ 2.0.7
Hi,
that's very bad... please use another user than root for PHP scripts!
bye
Thorsten
that's very bad... please use another user than root for PHP scripts!
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Re: Attaching Files in phpMyFAQ 2.0.7
HI,
o.k. will do - it's on a single user development box at the moment - so I haven't been too careful with that.
Is changing the user/owner likely to fix this issue.?
Thanks
Graham
o.k. will do - it's on a single user development box at the moment - so I haven't been too careful with that.
Is changing the user/owner likely to fix this issue.?
Thanks
Graham
Re: Attaching Files in phpMyFAQ 2.0.7
Hi,
bye
Thorsten
after changing the owner it should work...grahamar wrote:Is changing the user/owner likely to fix this issue.?
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Re: Attaching Files in phpMyFAQ 2.0.7
Thanks - I 'll change it and if further problems occur I'll come back to you.
Appreciate the prompt assistance.
Graham
Appreciate the prompt assistance.
Graham