包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
原文:
最满意答案
使用类似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 ...
-
mongo db中的别名(alias in mongo db)[2022-08-25]
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 ... -
Mongo DB Aggregate(Mongo DB Aggregate)[2022-12-21]
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" } ... -
如何从红宝石中分组mongo(How to group in mongo from ruby)[2021-10-03]
好的,经过一段时间的实验,设法解决了这个问题。 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 ...
-
mongo db中的会话表(session table in mongo db)[2021-09-09]
TTL是好的,然而所有修复都没有。 --repair不是设计为在数据库上定期运行,实际上可能每3个月或其他一次。 它会执行许多内部操作,如果经常运行,会严重损害服务器性能。 现在关于在这样的环境中重用磁盘空间; 删除记录时,它将释放“阻止”。 如果另一个文档适合该“块”,它将重用该空间,否则它将实际创建一个新的范围,意味着一个新的“块”又名更多的空间。 因此,如果你想在这里节省磁盘空间,你需要确保文件不会相互超过,幸运的是你有一个相对静态的模式: { _id: {}, token: {}, ... -
从具有多个where条件的Mongo DB 3.0.15中删除记录(Remove records from Mongo DB 3.0.15 with multiple where condition)[2022-03-17]
您可以使用$或运算符之类的 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 ...