具有不同php安装的系统上的composer Cpanel

时间:2016-03-22 07:02:15

标签: php composer-php cpanel shebang

我需要在任何服务器上使用composer作为项目。

此服务器在系统上有一个非常旧的PHP版本。

但我不需要使用Cpanel PHP版本。

我需要自己的程序使用Cpanel内部版本位于/ usr / local / cpanel / 3rdparty / php / 54 /

我尝试修改shebang

原始

#!/usr/bin/env php

更改

#!/usr/local/cpanel/3rdparty/php/54/

但不行。

1 个答案:

答案 0 :(得分:1)

如果/usr/local/cpanel/3rdparty/php/54/php composer.phar包含php二进制文件,则必须将该路径提供给shebang:

public void send() {
        new Thread(new Runnable() {

            @Override
            public void run() {
                Properties props = System.getProperties();
                props.put("mail.smtp.host", "103.20.XXX.XXX");
                props.put("mail.smtp.auth", "true");
                props.put("mail.smtp.port", "25");

                Session mailSession = Session.getDefaultInstance(props, null);
                //mailSession.setDebug(true);

                try {
                    Message mailMessage = new MimeMessage(mailSession);
                    mailMessage.setFrom(new InternetAddress(msgFrom, username));
                    mailMessage.setRecipient(Message.RecipientType.TO, new InternetAddress(msgTo));
                    mailMessage.setSubject(msgSubject);
                    mailMessage.setContent(msgBody, "text/html; charset=utf-8");
                    Transport transport = mailSession.getTransport("smtp");
                    transport.connect("103.20.XXX.XXX", username, password);
                    transport.sendMessage(mailMessage, mailMessage.getAllRecipients());
                    transport.close();

                } catch (MessagingException | UnsupportedEncodingException e) {
                    e.printStackTrace();
                }
            }
        }).start();
    }

此外,您应该可以致电 { "type": "http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/", "title": "Resource Not Found", "status": 404, "detail": "The requested resource could not be found.", "instance": "" }