0

I've problem with swiftmailer on a shared host, it uses getmypid() to generate random strings but getmypid() is disabled

'getmypid() has been disabled for security reasons' in /home/.../laravel4/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php
                   

what should I do? can I replace getmypid() with something else?

here is the whole file


                   

edit *                    

First i commented the getmypid(), but now sometimes I get following error

production.ERROR: exception 'ErrorException' with message 'fopen(/tmp/4de589a57816fff756ac16f771986876/body): failed to open stream: Permission denied' in /home/ekbatana/laravel4/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php:300"
                   

and I suspect that maybe the absence of getmypid() causes this


           

       

1 Answer  正确答案                


               

                  把  SimpleMimeEntity.php                 

                 文件里所有的 getmypid()                  

                 替换为 mt_rand(0, 32000)  函数