SWXphp vhost配置/open_basedir/safe_mode

本文介绍了解决在虚拟主机环境下运行SWXPHP时遇到的错误问题,特别是关于PHP.ini配置中open_basedir和SafeMode限制的问题,并提供了一种在特定目录下禁用这些限制的方法。

在虚拟主机目录运行SWXPHP报错。

 

Warning: open_basedir is set in PHP.ini . Certain SWX APIs will not work properly with this restriction. Please turn open_basedir off (or contact your web host and ask them to do this for you.)
Warning: Safe Mode is on in PHP.ini . SWX will not work properly with this restriction. Please turn Safe Mode off (or contact your web host and ask them to do this for you.)


修正方法:

在<Directory “f:/mobile”>

php_admin_value safe_mode 0
php_admin_value open_basedir none

</Directory》



/* * Vhost-user RDMA device : init and packets forwarding * * Copyright (C) 2025 KylinSoft Inc. and/or its affiliates. All rights reserved. * * Author: Xiong Weimin <xiongweimin@kylinos.cn> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #ifndef VHOST_RDMA_QUEUE_H_ #define VHOST_RDMA_QUEUE_H_ #include <stdint.h> #include <stdbool.h> #include <linux/types.h> #include "vhost_rdma_ib.h" enum vhost_rdma_ib_wc_opcode { VHOST_RDMA_IB_WC_SEND, VHOST_RDMA_IB_WC_RDMA_WRITE, VHOST_RDMA_IB_WC_RDMA_READ, VHOST_RDMA_IB_WC_RECV, VHOST_RDMA_IB_WC_RECV_RDMA_WITH_IMM, }; enum vhost_rdma_ib_wc_status { /* Operation completed successfully */ VHOST_RDMA_IB_WC_SUCCESS, /* Local Length Error */ VHOST_RDMA_IB_WC_LOC_LEN_ERR, /* Local QP Operation Error */ VHOST_RDMA_IB_WC_LOC_QP_OP_ERR, /* Local Protection Error */ VHOST_RDMA_IB_WC_LOC_PROT_ERR, /* Work Request Flushed Error */ VHOST_RDMA_IB_WC_WR_FLUSH_ERR, /* Bad Response Error */ VHOST_RDMA_IB_WC_BAD_RESP_ERR, /* Local Access Error */ VHOST_RDMA_IB_WC_LOC_ACCESS_ERR, /* Remote Invalid Request Error */ VHOST_RDMA_IB_WC_REM_INV_REQ_ERR, /* Remote Access Error */ VHOST_RDMA_IB_WC_REM_ACCESS_ERR, /* Remote Operation Error */ VHOST_RDMA_IB_WC_REM_OP_ERR, /* Transport Retry Counter Exceeded */ VHOST_RDMA_IB_WC_RETRY_EXC_ERR, /* RNR Retry Counter Exceeded */ VHOST_RDMA_IB_WC_RNR_RETRY_EXC_ERR, /* Remote Aborted Error */ VHOST_RDMA_IB_WC_REM_ABORT_ERR, /* Fatal Error */ VHOST_RDMA_IB_WC_FATAL_ERR, /* Response Timeout Error */ VHOST_RDMA_IB_WC_RESP_TIMEOUT_ERR, /* General Error */ VHOST_RDMA_IB_WC_GENERAL_ERR }; enum vhost_rdma_ib_wr_opcode { VHOST_RDMA_IB_WR_RDMA_WRITE, VHOST_RDMA_IB_WR_RDMA_WRITE_WITH_IMM, VHOST_RDMA_IB_WR_SEND, VHOST_RDMA_IB_WR_SEND_WITH_IMM, VHOST_RDMA_IB_WR_RDMA_READ, }; enum vhost_rdma_queue_type { VHOST_RDMA_QUEUE_SQ, VHOST_RDMA_QUEUE_RQ, }; struct vhost_rdma_sq_req { union { /* Length of sg_list */ __le32 num_sge; /* Length of inline data */ __le16 inline_len; }; /* Flags of the WR properties */ __u8 send_flags; /* WR opcode, enum vhost_rdma_ib_wr_opcode */ __u32 opcode; /* User defined WR ID */ __le64 wr_id; #define VHOST_RDMA_IB_SEND_FENCE (1 << 0) #define VHOST_RDMA_IB_SEND_SIGNALED (1 << 1) #define VHOST_RDMA_IB_SEND_SOLICITED (1 << 2) #define VHOST_RDMA_IB_SEND_INLINE (1 << 3) /* Immediate data (in network byte order) to send */ __le32 imm_data; union { __le32 imm_data; __u32 invalidate_rkey; } ex; union { struct { /* Start address of remote memory buffer */ __le64 remote_addr; /* Key of the remote MR */ __le32 rkey; } rdma; struct { __u64 remote_addr; __u64 compare_add; __u64 swap; __u32 rkey; } atomic; struct { /* Index of the destination QP */ __le32 remote_qpn; /* Q_Key of the destination QP */ __le32 remote_qkey; /* Address Handle */ __le32 ah; } ud; /* Reserved for future */ __le64 reserved[4]; }; /* Inline data */ //__u8 inline_data[512]; /* Reserved for future */ __le32 reserved2[3]; /* Scatter/gather list */ struct vhost_rdma_sge sg_list[]; }; struct vhost_rdma_rq_req { __le32 qpn; /* Length of sg_list */ __le32 num_sge; /* User defined WR ID */ __le64 wr_id; /* Scatter/gather list */ struct vhost_rdma_sge sg_list[]; }; struct vhost_rdma_dma_info { uint32_t length; uint32_t resid; uint32_t cur_sge; uint32_t num_sge; uint32_t sge_offset; uint32_t reserved; union { uint8_t *inline_data; struct vhost_rdma_sge *sge; void *raw; }; }; struct vhost_rdma_send_wqe { struct vhost_rdma_sq_req *wr; struct vhost_rdma_av av; __u32 status; __u32 state; __aligned_u64 iova; __u32 mask; __u32 first_psn; __u32 last_psn; __u32 ack_length; __u32 ssn; __u32 has_rd_atomic; struct vhost_rdma_dma_info dma; }; struct vhost_rdma_cq_req { /* User defined WR ID */ __le64 wr_id; /* Work completion status, enum virtio_ib_wc_status */ __u8 status; /* WR opcode, enum virtio_ib_wc_opcode */ __u8 opcode; /* Padding */ __le16 padding; /* Vendor error */ __le32 vendor_err; /* Number of bytes transferred */ __le32 byte_len; /* Immediate data (in network byte order) to send */ __le32 imm_data; /* Local QP number of completed WR */ __le32 qp_num; /* Source QP number (remote QP number) of completed WR (valid only for UD QPs) */ __le32 src_qp; #define VHOST_RDMA_IB_WC_GRH (1 << 0) #define VHOST_RDMA_WC_WITH_IMM (1 << 1) /* Work completion flag */ __le32 wc_flags; /* Reserved for future */ __le32 reserved[3]; }; void init_send_wqe(struct vhost_rdma_qp *qp, struct vhost_rdma_sq_req *wr, unsigned int mask, unsigned int length, struct vhost_rdma_send_wqe *wqe); void vhost_rdma_handle_sq(void *arg); void vhost_rdma_handle_rq(__rte_unused void *arg); int vhost_rdma_cq_post(struct vhost_rdma_device *dev, struct vhost_rdma_cq *cq, struct vhost_rdma_cq_req *cqe, int solicited); int vhost_rdma_queue_init(struct vhost_rdma_qp *qp, struct vhost_rdma_queue* queue, const char* name, struct vhost_user_queue* vq, size_t elem_size, enum vhost_rdma_queue_type type); void vhost_rdma_queue_cleanup(struct vhost_rdma_qp *qp, struct vhost_rdma_queue* queue); #endif 添加英文注释
最新发布
10-12
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值