首页 \ 问答 \ 包php5在Ubuntu 16.04 LTS上没有安装候选(Package php5 has no installation candidate on Ubuntu 16.04 LTS)

包php5在Ubuntu 16.04 LTS上没有安装候选(Package php5 has no installation candidate on Ubuntu 16.04 LTS)

我已经将我的系统升级到ubuntu 16.04 LTS,现在我已经发布了这个更新的版本安装PHP 7并删除了PHP 5,如何在ubuntu 16.04 LTS上安装PHP 5.4?

我试过了:

sudo apt-get install php5

我收到了这个错误:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package php5 is not available but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package php5 has no installation candidate

I have upgraded my system to ubuntu 16.04 LTS, now I have issue this newer version install PHP 7 and remove the PHP 5, How I can install PHP 5.4 on ubuntu 16.04 LTS?

I tried:

sudo apt-get install php5

and I got this error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package php5 is not available but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package php5 has no installation candidate

原文:
更新时间:2023-02-11 08:02

最满意答案

使用类似Mongoid的ODM可以减轻您的痛苦。 将它添加到您的Gemfile

gem 'mongoid'

并运行bundle install 。 确保浏览安装指南以添加所有必要的配置。 然后在您的模型/类中包含以下行:

class Product
  include Mongoid::Document
  ...
end

您将能够立即查询像Product.find(id)这样的记录。


Using an ODM like Mongoid will ease your pain. Add it to your Gemfile:

gem 'mongoid'

and run bundle install. Make sure you skimmed through the installation guide to add all the necessary configs. Then include the following line to your model/class, say:

class Product
  include Mongoid::Document
  ...
end

You'll be able to query the records like Product.find(id) right after.

相关问答

更多
  • 你也需要安装MongoDB。 既然你在Ubuntu上,试试这个: sudo apt-get install mongodb 如果您在阅读的任何说明中看到任何brew命令,那么这些命令可能适用于Mac OS X上的Homebrew,而不适用于Ubuntu。 You need to have MongoDB installed, too. Since you're on Ubuntu, try this: sudo apt-get install mongodb If you saw any brew co ...
  • Mongodb不使用SQL,它更像是对象查询语言和集合。 您可以尝试的是,有些东西类似于使用Mongo Java Driver的下面的代码 Pojo obj = new PojoInstance(); obj.setId(id); db.yourdb.find(obj); I've end up using the following approach in the Java Driver: DBCursor cursor = runSomeQuery(); try { while(cur ...
  • You need to `$group` each credit/debit/tax-Account/Amount and calculate sum. db.collection.aggregate([ { $group: { _id:{_id:"$placeName",date:{$dateToString:{format:"%Y-%m-%d" , date:"$created"}}, creditAccount:"$creditAccount" } ...
  • 好的,经过一段时间的实验,设法解决了这个问题。 trucks = @mongoCollection.group( ["route", "assetId"], { }, { }, "function() {}") OK, managed to fix this after spending a while experimenting. trucks = @mongoCollection.group( ["route", "assetId"], { }, { }, "function() {}")
  • 时间戳可以从ObjectId Mongo dcs中提取更多详细信息 Timestamp can be extracted from ObjectId Mongo dcs More details here
  • 对数组使用$nin而不是$ne 。 就像是: $search = array( '_id' => array('$nin' => $ids), 'readby' => array('$ne' => $userId) ); 应该做你想做的事。 Use $nin instead of $ne with arrays. Something like: $search = array( '_id' => array('$nin' => $ids), 'readby' => arra ...
  • TTL是好的,然而所有修复都没有。 --repair不是设计为在数据库上定期运行,实际上可能每3个月或其他一次。 它会执行许多内部操作,如果经常运行,会严重损害服务器性能。 现在关于在这样的环境中重用磁盘空间; 删除记录时,它将释放“阻止”。 如果另一个文档适合该“块”,它将重用该空间,否则它将实际创建一个新的范围,意味着一个新的“块”又名更多的空间。 因此,如果你想在这里节省磁盘空间,你需要确保文件不会相互超过,幸运的是你有一个相对静态的模式: { _id: {}, token: {}, ...
  • 您可以使用$或运算符之类的 db.test.remove({ $or: [ { "name": "a" }, { "name" : "b" } ] }) You can use $or operator like db.test.remove({ $or: [ { "name": "a" }, { "name" : "b" } ] })
  • 使用类似Mongoid的ODM可以减轻您的痛苦。 将它添加到您的Gemfile : gem 'mongoid' 并运行bundle install 。 确保浏览安装指南以添加所有必要的配置。 然后在您的模型/类中包含以下行: class Product include Mongoid::Document ... end 您将能够立即查询像Product.find(id)这样的记录。 Using an ODM like Mongoid will ease your pain. Add it to ...
  • 你正在寻找$nin 。 根据文件 , $nin选择以下文件: field值不在指定的数组中 该field不存在。 尝试 foo = db.collection.find({ "data": { "$nin": [504, 400] }, }) You are looking for $nin. According to the documentation, $nin selects the documents where: the field value is not in the specifi ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)